Skip to content

Commit

Permalink
Merge pull request #11 from thomas-neumann-axtesys/assigned_orgu_posi…
Browse files Browse the repository at this point in the history
…tion_fix

Add null check for AssignedOrguPosition before assigning.
  • Loading branch information
mstuder authored Nov 24, 2023
2 parents e128e89 + e5156b1 commit 69163e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/UserSetting/UserSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,9 @@ protected function assignOrgunits() {
continue;
}
$orgUnit = new ilObjOrgUnit($orgu_ref_id, true);
ilOrgUnitUserAssignment::findOrCreateAssignment($usr_id, (int)$this->getAssignedOrguPosition(), $orgUnit->getRefId());
if (!is_null($this->getAssignedOrguPosition())) {
ilOrgUnitUserAssignment::findOrCreateAssignment($usr_id, (int)$this->getAssignedOrguPosition(), $orgUnit->getRefId());
}
}

return true;
Expand Down

0 comments on commit 69163e5

Please sign in to comment.