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