mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-24 12:17:05 -08:00
Fix error if the Department is also empty
This commit is contained in:
parent
5c7aaaac22
commit
11aa8971c8
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue