Skip to content

Commit 714b863

Browse files
authored
Merge pull request #44 from 5am-code/fix/property-last_edited_time
fix: check if last_edited_time is a string
2 parents 37faf15 + 7716380 commit 714b863

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Entities/Properties/LastEditedTime.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use DateTime;
66
use Exception;
77
use FiveamCode\LaravelNotionApi\Exceptions\HandlingException;
8+
use Throwable;
89

910
/**
1011
* Class LastEditedTime
@@ -20,10 +21,10 @@ protected function fillFromRaw(): void
2021
parent::fillFromRaw();
2122

2223
try {
23-
if ($this->rawContent !== null) {
24+
if (is_string($this->rawContent) && $this->rawContent !== null) {
2425
$this->content = new DateTime($this->rawContent);
2526
}
26-
} catch (Exception $e) {
27+
} catch (Throwable $e) {
2728
throw HandlingException::instance('The content of last_edited_time is not a valid ISO 8601 date time string.');
2829
}
2930
}

0 commit comments

Comments
 (0)