Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render 404 Not Found for invalid problem filelink path
Previously, /problems/:id/files/download/:path with a non-existent path would crash with Pundit::NotDefinedError (unable to find policy of nil), because `find_by_filepath` returns nil if the record is not found and then `authorize @filelink, :show?` fails. Full error trace: ``` Completed 500 Internal Server Error in 311ms (ActiveRecord: 30.2ms) unable to find policy of nil excluded from capture: DSN not set Pundit::NotDefinedError (unable to find policy of nil): app/controllers/filelinks/roots_controller.rb:61:in `show' ```
- Loading branch information