浏览代码

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`.
tags/v0.11.1^0
Matt Baer 4 年前
父节点
当前提交
bd99044e9c
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. +4
    -4
      collections.go

+ 4
- 4
collections.go 查看文件

@@ -905,11 +905,11 @@ func handleViewCollectionTag(app *App, w http.ResponseWriter, r *http.Request) e
// Log the error and just continue
log.Error("Error getting user for collection: %v", err)
}
if owner.IsSilenced() {
return ErrCollectionNotFound
}
}
if !isOwner && u.IsSilenced() {
return ErrCollectionNotFound
}
displayPage.Suspended = u.IsSilenced()
displayPage.Suspended = owner != nil && owner.IsSilenced()
displayPage.Owner = owner
coll.Owner = displayPage.Owner
// Add more data


正在加载...
取消
保存