Sharp throws on unsupported formats (HEIC, corrupt files, etc.) and the error was propagated outside the try/catch, crashing the server. Moved the mkdir + sharp pipeline inside the catch block so any failure returns null and streamPhoto falls through to serving the original file. |
||
|---|---|---|
| .. | ||
| assets | ||
| public | ||
| scripts | ||
| src | ||
| tests | ||
| .env.example | ||
| package-lock.json | ||
| package.json | ||
| reset-admin.js | ||
| tsconfig.json | ||
| vitest.config.ts | ||