🚑 Fix nil pointer

This commit is contained in:
LittleSheep 2024-02-09 18:43:48 +08:00
parent 9d64449ae4
commit 5ce552f1be

View File

@ -154,7 +154,7 @@ func NewPost(
if !realm.IsPublic {
var member models.RealmMember
if err := database.C.Where(&models.RealmMember{
RealmID: *realmId,
RealmID: realm.ID,
AccountID: user.ID,
}).First(&member).Error; err != nil {
return post, fmt.Errorf("you aren't a part of that realm")