Add guard clause to obtain the default ID of imported asset's status label

This commit is contained in:
Ivan Nieto Vivanco 2023-06-22 13:53:58 -06:00
parent 17a10a4342
commit 67e47a7d8b

View file

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