Prevent 500 if license file is missing

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-11-14 17:42:40 +00:00
parent 6a9131e771
commit 077d343f01

View file

@ -463,16 +463,20 @@
</td>
<td>
@if ($file->filename)
@if ( Helper::checkUploadIsImage($file->get_src('licenses')))
@if ((Storage::exists('private_uploads/licenses/'.$file->filename)) && ( Helper::checkUploadIsImage($file->get_src('licenses'))))
<a href="{{ route('show.licensefile', ['licenseId' => $license->id, 'fileId' => $file->id, 'download' => 'false']) }}" data-toggle="lightbox" data-type="image"><img src="{{ route('show.licensefile', ['licenseId' => $license->id, 'fileId' => $file->id]) }}" class="img-thumbnail" style="max-width: 50px;"></a>
@endif
@endif
</td>
<td>
@if (Storage::exists('private_uploads/licenses/'.$file->filename))
{{ $file->filename }}
@else
<del>{{ $file->filename }}</del>
@endif
</td>
<td data-value="{{ Storage::size('private_uploads/licenses/'.$file->filename) }}">
{{ Helper::formatFilesizeUnits(Storage::size('private_uploads/licenses/'.$file->filename)) }}
<td data-value="{{ (Storage::exists('private_uploads/licenses/'.$file->filename)) ? Storage::size('private_uploads/licenses/'.$file->filename) : '' }}">
{{ (Storage::exists('private_uploads/licenses/'.$file->filename)) ? Helper::formatFilesizeUnits(Storage::size('private_uploads/licenses/'.$file->filename)) : '' }}
</td>
<td>