Browse Source

Fix potential nil pointer crash

Tulir Asokan 6 năm trước cách đây
mục cha
commit
9fa0ad923d
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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)
 		}
 	}