Skip to content

Firefly III: a personal finances manager

Fix null pointer.

James Cole898459198d43
diff --git a/app/Support/Binder/Date.php b/app/Support/Binder/Date.php
index 6e2890fdd5..fed9673ad7 100644
--- a/app/Support/Binder/Date.php
+++ b/app/Support/Binder/Date.php
@@ -70,7 +70,7 @@ class Date implements BinderInterface
try {
$result = new Carbon($value);
} catch (InvalidDateException|InvalidFormatException $e) {
- $message = sprintf('Could not parse date "%s" for user #%d: %s', $value, auth()->user()->id, $e->getMessage());
+ $message = sprintf('Could not parse date "%s" for user #%d: %s', $value, (int) auth()->user()?->id, $e->getMessage());
Log::error($message);
throw new NotFoundHttpException('Could not parse value', $e);