From 11aa8971c8ba8695170be8300c76e0b1fadf6f1d Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Thu, 30 Sep 2021 17:20:44 -0500 Subject: [PATCH] Fix error if the Department is also empty --- app/Importer/UserImporter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Importer/UserImporter.php b/app/Importer/UserImporter.php index 27d08a58ea..707ee0e2db 100644 --- a/app/Importer/UserImporter.php +++ b/app/Importer/UserImporter.php @@ -118,10 +118,10 @@ class UserImporter extends ItemImporter */ public function createOrFetchDepartment($department_name) { - if(is_null($department_name)){ + if(is_null($department_name) || $department_name == ''){ return null; } - + $department = Department::where(['name' => $department_name])->first(); if ($department) { $this->log('A matching department '.$department_name.' already exists');