Przeglądaj źródła

Ticket #5282 - PHP warning in BxDolCronAcl.

AntonLV 10 miesięcy temu
rodzic
commit
323489fbbc
1 zmienionych plików z 5 dodań i 7 usunięć
  1. 5 7
      inc/classes/BxDolCronAcl.php

+ 5 - 7
inc/classes/BxDolCronAcl.php

@@ -45,13 +45,11 @@ class BxDolCronAcl extends BxDolCron
             }
 
             // clean memory
-            $oProfile = BxDolProfile::getInstance($iId);
-            $iAccountId = $oProfile->getAccountId();
-            $sClass = 'BxDolProfile_' . $iId;
-            unset($GLOBALS['bxDolClasses'][$sClass]);
-            $sClass = 'BxDolAccount_' . $iAccountId;
-            unset($GLOBALS['bxDolClasses'][$sClass]);
-            BxDolDb::getInstance()->cleanMemory('BxDolAclQuery::getLevelCurrent' . $iId . 0);
+            if(($oProfile = BxDolProfile::getInstance($iId)) !== false) {
+                unset($GLOBALS['bxDolClasses']['BxDolProfile_' . $iId]);
+                unset($GLOBALS['bxDolClasses']['BxDolAccount_' . $oProfile->getAccountId()]);
+                BxDolDb::getInstance()->cleanMemory('BxDolAclQuery::getLevelCurrent' . $iId . 0);
+            }
         }
     }
 }