A free open source IT asset/license management system
Add guard clause to obtain the default ID of imported asset's status label
Ivan Nieto Vivanco67e47a7d8b44
diff --git a/app/Importer/AssetImporter.php b/app/Importer/AssetImporter.phpindex e8da1e06b4..be19455618 100644--- a/app/Importer/AssetImporter.php+++ b/app/Importer/AssetImporter.php@@ -12,7 +12,10 @@ class AssetImporter extends ItemImporterpublic 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)