mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 06:04:08 -08:00
Check that the file exists before trying to stat it for filesize
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
3a1cf26e98
commit
cc7325074e
|
@ -126,7 +126,12 @@ class ImportController extends Controller
|
|||
}
|
||||
$file_name = date('Y-m-d-his').'-'.$fixed_filename;
|
||||
$import->file_path = $file_name;
|
||||
$import->filesize = null;
|
||||
|
||||
if (file_exists($path.'/'.$file_name)) {
|
||||
$import->filesize = filesize($path.'/'.$file_name);
|
||||
}
|
||||
|
||||
$import->save();
|
||||
$results[] = $import;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue