Skip to content

Commit f549ba0

Browse files
committed
Fixed a case where a function could be called on null
1 parent 04420b2 commit f549ba0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/code/community/Webbhuset/Geoip/Model/Observer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ public function checkNoRoute()
150150
$geoIP = Mage::getSingleton('geoip/country');
151151
$currentCountry = $geoIP->getCountry();
152152
$response = Mage::app()->getResponse();
153+
$store = null;
153154

154155
if ($currentCountry) {
155156
$store = $this->_getStoreForCountry($currentCountry);
156-
} else {
157-
$store = $this->_getFallbackStore();
158157
}
158+
$store = $store ?: $this->_getFallbackStore();
159159

160160
$response->setRedirect($store->getCurrentUrl(false))->sendResponse();
161161
exit;

0 commit comments

Comments
 (0)