Skip to content

Commit cadc545

Browse files
authored
Merge pull request #16 from itk-dev/feature/no-init-error
ITKDev: Fixes must not be accessed before initialization
2 parents d793776 + e78aba8 commit cadc545

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/LookupResult/CompanyLookupResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public function setAddress(string $address): void {
352352
* The field value or the empty string if the field does not exist.
353353
*/
354354
public function getFieldValue(string $field): mixed {
355-
if (property_exists($this, $field)) {
355+
if (property_exists($this, $field) && isset($this->{$field})) {
356356
return $this->{$field};
357357
}
358358

src/LookupResult/CprLookupResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ public function hasGuardian(string $cpr): bool {
672672
* The value of the field or the empty string.
673673
*/
674674
public function getFieldValue(string $field): mixed {
675-
if (property_exists($this, $field)) {
675+
if (property_exists($this, $field) && isset($this->{$field})) {
676676
return $this->{$field};
677677
}
678678

0 commit comments

Comments
 (0)