]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/user/class_ShipSimuBaseUser.php
Missing variable declared
[shipsimu.git] / application / ship-simu / main / user / class_ShipSimuBaseUser.php
index 96a107f666b881d7c0da4e95b01b34474bda2ded..426edcbedceceb92fd398a835a3c173626e1209e 100644 (file)
@@ -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)) {