소스 검색

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