Fix 500 on tags page
This fixes a panic from a nil user when calling u.IsSuspended(). Instead, this checks and calls IsSuspended() on `owner`.
This commit is contained in:
parent
2899d98cfd
commit
bd99044e9c
|
@ -905,11 +905,11 @@ func handleViewCollectionTag(app *App, w http.ResponseWriter, r *http.Request) e
|
||||||
// Log the error and just continue
|
// Log the error and just continue
|
||||||
log.Error("Error getting user for collection: %v", err)
|
log.Error("Error getting user for collection: %v", err)
|
||||||
}
|
}
|
||||||
|
if owner.IsSilenced() {
|
||||||
|
return ErrCollectionNotFound
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if !isOwner && u.IsSilenced() {
|
displayPage.Suspended = owner != nil && owner.IsSilenced()
|
||||||
return ErrCollectionNotFound
|
|
||||||
}
|
|
||||||
displayPage.Suspended = u.IsSilenced()
|
|
||||||
displayPage.Owner = owner
|
displayPage.Owner = owner
|
||||||
coll.Owner = displayPage.Owner
|
coll.Owner = displayPage.Owner
|
||||||
// Add more data
|
// Add more data
|
||||||
|
|
Loading…
Reference in New Issue