From 42728b4ea12607707e721754a255e6dbe65db5e0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 13 Apr 2017 10:32:09 +0300 Subject: [PATCH] Fix custom gateway check --- app/Listeners/HandleUserLoggedIn.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Listeners/HandleUserLoggedIn.php b/app/Listeners/HandleUserLoggedIn.php index eb59cc9b62..52eca07bd2 100644 --- a/app/Listeners/HandleUserLoggedIn.php +++ b/app/Listeners/HandleUserLoggedIn.php @@ -69,8 +69,11 @@ class HandleUserLoggedIn } // check custom gateway id is correct - if (! Utils::isNinja() && Gateway::find(GATEWAY_CUSTOM)->name !== 'Custom') { - Session::flash('error', trans('texts.error_incorrect_gateway_ids')); + if (! Utils::isNinja()) { + $gateway = Gateway::find(GATEWAY_CUSTOM); + if (! $gateway || $gateway->name !== 'Custom') { + Session::flash('error', trans('texts.error_incorrect_gateway_ids')); + } } } }