mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-04 18:15:43 +00:00
Fix error if the Department is also empty
This commit is contained in:
@ -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');
|
||||
|
||||
Reference in New Issue
Block a user