Skip to content

Commit

Permalink
Merge pull request #16 from itk-dev/feature/no-init-error
Browse files Browse the repository at this point in the history
ITKDev: Fixes must not be accessed before initialization
  • Loading branch information
jekuaitk authored Dec 6, 2024
2 parents d793776 + e78aba8 commit cadc545
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/LookupResult/CompanyLookupResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public function setAddress(string $address): void {
* The field value or the empty string if the field does not exist.
*/
public function getFieldValue(string $field): mixed {
if (property_exists($this, $field)) {
if (property_exists($this, $field) && isset($this->{$field})) {
return $this->{$field};
}

Expand Down
2 changes: 1 addition & 1 deletion src/LookupResult/CprLookupResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ public function hasGuardian(string $cpr): bool {
* The value of the field or the empty string.
*/
public function getFieldValue(string $field): mixed {
if (property_exists($this, $field)) {
if (property_exists($this, $field) && isset($this->{$field})) {
return $this->{$field};
}

Expand Down

0 comments on commit cadc545

Please sign in to comment.