Browse Source

Ticket #4657 - PHP error on profile relations page.

AntonLV 2 years ago
parent
commit
eb3caaa757
1 changed files with 10 additions and 2 deletions
  1. 10 2
      template/scripts/BxBaseServiceConnections.php

+ 10 - 2
template/scripts/BxBaseServiceConnections.php

@@ -326,7 +326,11 @@ class BxBaseServiceConnections extends BxDol
         if(!$iProfileId && bx_get('profile_id') !== false)
         if(!$iProfileId && bx_get('profile_id') !== false)
             $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
             $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
 
 
-        $aProfile = BxDolProfile::getInstance($iProfileId)->getInfo();
+        $oProfile = false;
+        if(!$iProfileId || !($oProfile = BxDolProfile::getInstance($iProfileId)))
+            return false;
+
+        $aProfile = $oProfile->getInfo();
         if(empty($aProfile) || !is_array($aProfile))
         if(empty($aProfile) || !is_array($aProfile))
             return false;
             return false;
 
 
@@ -359,7 +363,11 @@ class BxBaseServiceConnections extends BxDol
         if(!$iProfileId && bx_get('profile_id') !== false)
         if(!$iProfileId && bx_get('profile_id') !== false)
             $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
             $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
 
 
-        $aProfile = BxDolProfile::getInstance($iProfileId)->getInfo();
+        $oProfile = false;
+        if(!$iProfileId || !($oProfile = BxDolProfile::getInstance($iProfileId)))
+            return false;
+
+        $aProfile = $oProfile->getInfo();
         if(empty($aProfile) || !is_array($aProfile))
         if(empty($aProfile) || !is_array($aProfile))
             return false;
             return false;