diff options
| author | Moritz Strohm <strohm@data-quest.de> | 2022-09-28 12:47:45 +0000 |
|---|---|---|
| committer | Moritz Strohm <strohm@data-quest.de> | 2022-09-28 12:47:45 +0000 |
| commit | 1e6f3d59c1989dc0da68d3200090cb4768ab3094 (patch) | |
| tree | 6b07aa6aca6595c5dfc0c2aa446b0fe2d8847ef1 /lib/models/SimpleORMap.class.php | |
| parent | 9e13d2f5fa4726b54efe8ad046d0b53aadb543bf (diff) | |
fix for BIESt #1110
Merge request studip/studip!675
Diffstat (limited to 'lib/models/SimpleORMap.class.php')
| -rw-r--r-- | lib/models/SimpleORMap.class.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/models/SimpleORMap.class.php b/lib/models/SimpleORMap.class.php index cf09f45..5fed34a 100644 --- a/lib/models/SimpleORMap.class.php +++ b/lib/models/SimpleORMap.class.php @@ -1465,7 +1465,7 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate $field = strtolower($field); $options = $this->getRelationOptions($relation); if ($options['type'] === 'has_one' || $options['type'] === 'belongs_to') { - return $this->{$relation}->{$field}; + return $this->{$relation}->{$field} ?? null; } else { throw new InvalidArgumentException('Relation ' . $relation . ' not found or not applicable.'); } |
