Skip to content

Commit aded1c5

Browse files
committed
Profile: deal with null DOB
1 parent cd7b5ed commit aded1c5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/HMS/Entities/Profile.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,11 @@ public function setContactNumber(?string $contactNumber): Profile
271271
*/
272272
public function getDateOfBirth(): ?Carbon
273273
{
274-
return Carbon::instance($this->dateOfBirth);
274+
if ($this->dateOfBirth) {
275+
return Carbon::instance($this->dateOfBirth);
276+
}
277+
278+
return null;
275279
}
276280

277281
/**

0 commit comments

Comments
 (0)