Bläddra i källkod

Fix potential nil pointer crash

Tulir Asokan 6 år sedan
förälder
incheckning
9fa0ad923d
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      portal.go

+ 1 - 1
portal.go

@@ -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)
 		}
 		}
 	}
 	}