Fix nullpointers.

This commit is contained in:
James Cole
2021-04-07 14:18:43 +02:00
parent c67b10e38d
commit 4f42eb1796
3 changed files with 10 additions and 5 deletions

View File

@@ -35,6 +35,7 @@ use Illuminate\Session\TokenMismatchException;
use Illuminate\Support\Arr;
use Illuminate\Validation\ValidationException as LaravelValidationException;
use League\OAuth2\Server\Exception\OAuthServerException;
use Laravel\Passport\Exceptions\OAuthServerException as LaravelOAuthException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Throwable;
@@ -54,6 +55,7 @@ class Handler extends ExceptionHandler
LaravelValidationException::class,
NotFoundHttpException::class,
OAuthServerException::class,
LaravelOAuthException::class,
TokenMismatchException::class,
];

View File

@@ -140,7 +140,7 @@ class EditController extends Controller
'deposit_source_id' => $array['transactions'][0]['source_id'],
'withdrawal_destination_id' => $array['transactions'][0]['destination_id'],
];
$array['first_date'] = substr($array['first_date'], 0, 10);
$array['first_date'] = substr((string)$array['first_date'], 0, 10);
$array['repeat_until'] = substr((string)$array['repeat_until'], 0, 10);
$array['transactions'][0]['tags'] = implode(',', $array['transactions'][0]['tags'] ?? []);

View File

@@ -35,6 +35,9 @@ class EitherConfigKey
'firefly.default_location',
'firefly.account_to_transaction',
'firefly.allowed_opposing_types',
'firefly.accountRoles',
'firefly.valid_liabilities',
'firefly.interest_periods'
];
/**
* @param string $value