From 7d30001ff803c84149571d53dde8c8fa81497724 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Wed, 8 Nov 2023 15:32:33 -0600 Subject: [PATCH] Ignore the importer checkout if user is not found --- app/Importer/AssetImporter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Importer/AssetImporter.php b/app/Importer/AssetImporter.php index cd2b29205f..cf762a8fd4 100644 --- a/app/Importer/AssetImporter.php +++ b/app/Importer/AssetImporter.php @@ -144,7 +144,7 @@ class AssetImporter extends ItemImporter // If we have a target to checkout to, lets do so. //-- user_id is a property of the abstract class Importer, which this class inherits from and it's setted by //-- the class that needs to use it (command importer or GUI importer inside the project). - if (isset($target)) { + if (isset($target) && ($target !== false)) { if (!is_null($asset->assigned_to)){ if ($asset->assigned_to != $target->id){ event(new CheckoutableCheckedIn($asset, User::find($asset->assigned_to), Auth::user(), $asset->notes, date('Y-m-d H:i:s')));