🐛 Fix get cannot get other attachment userinfo

This commit is contained in:
LittleSheep 2024-07-31 15:11:15 +08:00
parent 8196aac3de
commit 03f08f1ff6

View File

@ -21,7 +21,7 @@ const metadataCacheLimit = 512
var metadataCache sync.Map
func GetAttachmentByID(id uint) (models.Attachment, error) {
if val, ok := metadataCache.Load(id); ok {
if val, ok := metadataCache.Load(id); ok && val.(models.Attachment).AccountID > 0 {
return val.(models.Attachment), nil
}