浏览代码

Fix potential nil pointer crash

Tulir Asokan 6 年之前
父节点
当前提交
9fa0ad923d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      portal.go

+ 1 - 1
portal.go

@@ -735,7 +735,7 @@ func (portal *Portal) CreateMatrixRoom(user *User) error {
 		portal.SyncParticipants(metadata)
 	} else {
 		customPuppet := portal.bridge.GetPuppetByCustomMXID(user.MXID)
-		if customPuppet.CustomIntent() != nil {
+		if customPuppet != nil && customPuppet.CustomIntent() != nil {
 			_ = customPuppet.CustomIntent().EnsureJoined(portal.MXID)
 		}
 	}