FIX: Use find_by_id method to prevent record not found exception

This commit is contained in:
Vinoth Kannan
2018-12-15 03:19:45 +05:30
parent 430083019d
commit 0d3c1cde90
2 changed files with 7 additions and 1 deletions

View File

@@ -513,7 +513,7 @@ class CookedPostProcessor
end
upload_id = downloaded_images[src]
upload = Upload.find(upload_id) if upload_id
upload = Upload.find_by_id(upload_id) if upload_id
img["src"] = upload.url if upload.present?
# make sure we grab dimensions for oneboxed images