Fix potential nil pointer crash

This commit is contained in:
Tulir Asokan committed 2019-06-01 19:20:06 +03:00
1 parent 4a13ae731a
commit 9fa0ad923d
1 file changed
+1 -1
+1 -1
View File
@@ -735,7 +735,7 @@ func (portal *Portal) CreateMatrixRoom(user *User) error {
portal.SyncParticipants(metadata) portal.SyncParticipants(metadata)
} else { } else {
customPuppet := portal.bridge.GetPuppetByCustomMXID(user.MXID) customPuppet := portal.bridge.GetPuppetByCustomMXID(user.MXID)
if customPuppet.CustomIntent() != nil { if customPuppet != nil && customPuppet.CustomIntent() != nil {
_ = customPuppet.CustomIntent().EnsureJoined(portal.MXID) _ = customPuppet.CustomIntent().EnsureJoined(portal.MXID)
} }
} }