Fix error if the Department is also empty

This commit is contained in:
Ivan Nieto Vivanco 2021-09-30 17:20:44 -05:00
parent 5c7aaaac22
commit 11aa8971c8

View file

@ -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');