Fix further issues with missing file attachments.
Review Request #6444 — Created Oct. 14, 2014 and submitted — Latest diff uploaded
The previous fix for missing file attachments broke once the
f.close()
call was moved into thefinally:
block if the file attachment was
missing, due to the fact that the initial statement failed andf
was
not a valid variable. This change fixes this by creating two separate
try/except
blocks.It also sandboxes the generation of text-based file attachment comment
thumbnails, which would also break the page if the file was missing.
Tested on a review request where both issues were hit. I was able to
get the page to load.