Merge pull request #13196 from inietov/fixes/default_status_labels_when_import

Fixed issue when importing Assets and no status labels exists [sc-23359]
This commit is contained in:
snipe 2023-06-22 21:34:25 +01:00 committed by GitHub
commit 8c6bde335e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,10 @@ class AssetImporter extends ItemImporter
public function __construct($filename)
{
parent::__construct($filename);
$this->defaultStatusLabelId = Statuslabel::first()->id;
if (!is_null(Statuslabel::first())) {
$this->defaultStatusLabelId = Statuslabel::first()->id;
}
}
protected function handle($row)