Fix crashes when attempting to download newly-added empty files.
Review Request #14995 — Created April 1, 2026 and submitted — Latest diff uploaded
When a diff contained a newly-added empty file, the resulting diff
entry would include a download link, which then crashed with a
PatchError. We've been getting these error emails a lot as bots have
crawled our server.This change applies two fixes:
- We no longer show a download link for new empty files.
- If somehow the download endpoint is accessed anyway, we catch
PatchErrorand return a 404.
- Verified that newly-added empty files no longer contained a download
link. - Ran unit tests.