Skip to content

Firefly III: a personal finances manager

Fix exception.

James Coleec73020b3cb5
diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php
index 30fbc5ea6b..be5de919b9 100644
--- a/app/Http/Controllers/PreferencesController.php
+++ b/app/Http/Controllers/PreferencesController.php
@@ -166,9 +166,13 @@ class PreferencesController extends Controller
// custom fiscal year
$customFiscalYear = 1 === (int)$request->get('customFiscalYear');
- $fiscalYearStart = date('m-d', strtotime((string)$request->get('fiscalYearStart')));
- app('preferences')->set('customFiscalYear', $customFiscalYear);
- app('preferences')->set('fiscalYearStart', $fiscalYearStart);
+ $string = strtotime((string)$request->get('fiscalYearStart'));
+ if(false !== $string) {
+ $fiscalYearStart = date('m-d', $string);
+ app('preferences')->set('customFiscalYear', $customFiscalYear);
+ app('preferences')->set('fiscalYearStart', $fiscalYearStart);
+ }
+
// save page size:
app('preferences')->set('listPageSize', 50);