Skip to content

Commit

Permalink
fix: hprnr can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasDev committed Dec 27, 2024
1 parent 6d9a8c2 commit 12535ad
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -429,17 +429,16 @@ class DokarkivClient(
return oppdaterJournalpostRequest
}

private fun padHpr(hprnummer: String): String {
if (hprnummer.length < 9) {
securelog.info("padder hpr: $hprnummer")
private fun padHpr(hprnummer: String?): String? {
if (hprnummer?.length != null && hprnummer.length < 9) {
return hprnummer.padStart(9, '0')
}
return hprnummer
}

private fun getAvsenderMottakerRequest(sykmelder: Sykmelder): AvsenderMottakerRequest {
return AvsenderMottakerRequest(
id = padHpr(sykmelder.hprNummer!!),
id = padHpr(sykmelder.hprNummer),
navn = finnNavn(sykmelder),
land = null,
idType = IdType.HPRNR,
Expand Down

0 comments on commit 12535ad

Please sign in to comment.