Improve code quality.

This commit is contained in:
James Cole
2018-07-09 19:24:08 +02:00
parent 76386dad7d
commit 5665f127aa
55 changed files with 278 additions and 100 deletions

View File

@@ -106,7 +106,14 @@ class LinkController extends Controller
return redirect(route('transactions.show', [$journal->id]));
}
$other = $this->journalRepository->findNull($linkInfo['transaction_journal_id']);
$other = $this->journalRepository->findNull($linkInfo['transaction_journal_id']);
if (null === $other) {
session()->flash('error', trans('firefly.invalid_link_selection'));
return redirect(route('transactions.show', [$journal->id]));
}
$alreadyLinked = $this->repository->findLink($journal, $other);
if ($other->id === $journal->id) {