Fixed an HTTP 500 error when the attached file does not exist