X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fship-simu%2Fmain%2Fuser%2Fclass_ShipSimuBaseUser.php;h=426edcbedceceb92fd398a835a3c173626e1209e;hb=0846b33552201b7a3b9d7e3debf83e7d073baaa3;hp=96a107f666b881d7c0da4e95b01b34474bda2ded;hpb=2b7c3e43b2fe0f3c5ae0455d13fa7743b638049f;p=shipsimu.git diff --git a/application/ship-simu/main/user/class_ShipSimuBaseUser.php b/application/ship-simu/main/user/class_ShipSimuBaseUser.php index 96a107f..426edcb 100644 --- a/application/ship-simu/main/user/class_ShipSimuBaseUser.php +++ b/application/ship-simu/main/user/class_ShipSimuBaseUser.php @@ -40,7 +40,7 @@ class ShipSimuBaseUser extends BaseUser implements Registerable, Updateable { */ public function ifUserCreatedMaximumAllowedCompanies () { // Get max allowed companies to found - $maxFound = $this->getConfigInstance()->readConfig('max_allowed_companies_found'); + $maxFound = $this->getConfigInstance()->getConfigEntry('max_allowed_companies_found'); // Now get a search criteria and set the user's name as criteria $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); @@ -70,8 +70,16 @@ class ShipSimuBaseUser extends BaseUser implements Registerable, Updateable { // Default is that everyone is poor... ;-) $hasRequired = false; - // Get a points instance from registry - $pointsInstance = Registry::getRegistry()->getInstance('points'); + // Init instance + $pointsInstance = null; + + try { + // Get a points instance from registry + $pointsInstance = Registry::getRegistry()->getInstance('points'); + } catch (NullPointerException $e) { + // Instance not found in registry + // @TODO We should log this exception later + } // Is there an instance? if (is_null($pointsInstance)) {