Fixed: tighter check for valid model #13349
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should honestly never ever happen, since at a the model level we check for a valid model, BUT when it does happen (assuming the user manually edited something in the database, or restored from the before times when we didn't validate as strictly) that an asset has an invalid or null
model_id
, this should return a friendlier error message (versus a 500 error.)This used to work this way, but when I added the model file tab and some of the manufacturer info, it assumed that relationship was a valid one, which broke the warning and would just then return a 500 error with a
Trying to get property 'uploads' of non-object at /Users/snipe/Sites/snipe-it/snipe-it/storage/framework/views
error.