From 71155d1999f0ff896b6058165f1d16c0e6b2acfb Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 13 Apr 2017 10:31:55 +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 3ece5ccc1b3d..6414ea62758f 100644 --- a/app/Listeners/HandleUserLoggedIn.php +++ b/app/Listeners/HandleUserLoggedIn.php @@ -71,8 +71,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')); + } } } }