Skip to content

Commit

Permalink
Merge pull request #1373 from navikt/no-address-fix
Browse files Browse the repository at this point in the history
Only prefill address if we actually have a address
  • Loading branch information
lotorvik authored Nov 28, 2024
2 parents 34eb332 + 67de5c5 commit 359bd19
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ class Address extends BaseComponent {
this.getKontaktadresse(prefillAddresses);
}

if (prefillAddress.landkode) {
super.setValue({
...prefillAddress,
land: getCountryObject(prefillAddress.landkode),
});
} else {
this.setValue(prefillAddress);
if (prefillAddress) {
if (prefillAddress.landkode) {
super.setValue({
...prefillAddress,
land: getCountryObject(prefillAddress.landkode),
});
} else {
this.setValue(prefillAddress);
}
}
}
}
Expand Down

0 comments on commit 359bd19

Please sign in to comment.