Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed 500 on missing license files #12105

Merged
merged 1 commit into from
Nov 14, 2022
Merged

Conversation

snipe
Copy link
Owner

@snipe snipe commented Nov 14, 2022

This would only happen if uploaded license files are missing. This checks to see that the file exists before it tries to get stats on the file.

Signed-off-by: snipe <snipe@snipe.net>
@what-the-diff
Copy link

what-the-diff bot commented Nov 14, 2022

  • Added a check to see if the file exists before displaying it.
  • If the file doesn't exist, we add tags around it so that users know they can no longer download this asset (since its been deleted).
  • We also added checks for when files don't exist in order to prevent errors from being thrown by Laravel's Storage facade methods like size() and exists(). This is because those methods throw exceptions instead of returning false or null values on failure, which makes them difficult to use with Blade templates without adding lots of try/catch blocks everywhere you want to call one of these functions.

@snipe snipe merged commit 15da39d into develop Nov 14, 2022
@snipe snipe deleted the fixes/500_on_missing_license_files branch November 14, 2022 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant