mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:42:02 +08:00
FIX: Handle the case where upload goes missing during downsizing
This commit is contained in:
parent
da0fc0a9d3
commit
cb048d284d
|
@ -28,7 +28,12 @@ class ShrinkUploadedImage
|
|||
end
|
||||
|
||||
# Neither #dup or #clone provide a complete copy
|
||||
original_upload = Upload.find(upload.id)
|
||||
original_upload = Upload.find_by(id: upload.id)
|
||||
unless original_upload
|
||||
log "Upload is missing"
|
||||
return false
|
||||
end
|
||||
|
||||
ww, hh = ImageSizer.resize(w, h)
|
||||
|
||||
# A different upload record that matches the sha1 of the downsized image
|
||||
|
|
Loading…
Reference in New Issue
Block a user