Finished journal repository.

This commit is contained in:
James Cole
2015-05-09 18:30:58 +02:00
parent 10e54b2263
commit 96ed9a4256
3 changed files with 340 additions and 18 deletions

View File

@@ -379,14 +379,19 @@ class JournalRepository implements JournalRepositoryInterface
$to = Account::find($data['account_to_id']);
break;
}
if (is_null($to->id)) {
if (is_null($to) || (!is_null($to) && is_null($to->id))) {
Log::error('"to"-account is null, so we cannot continue!');
App::abort(500, '"to"-account is null, so we cannot continue!');
// @codeCoverageIgnoreStart
}
if (is_null($from->id)) {
// @codeCoverageIgnoreEnd
if (is_null($from) || (!is_null($from) && is_null($from->id))) {
Log::error('"from"-account is null, so we cannot continue!');
App::abort(500, '"from"-account is null, so we cannot continue!');
// @codeCoverageIgnoreStart
}
// @codeCoverageIgnoreEnd
return [$from, $to];
}