diff --git a/src/bitrix24.php b/src/bitrix24.php index e894535d..e7e95c71 100644 --- a/src/bitrix24.php +++ b/src/bitrix24.php @@ -876,11 +876,13 @@ public function isAccessTokenExpire() // $url = 'https://'.self::OAUTH_SERVER.'/rest/app.info?auth='.$accessToken; $url = 'https://' . $domain . '/rest/app.info?auth=' . $accessToken; $requestResult = $this->executeRequest($url); - if (in_array($requestResult['error'], array('expired_token', 'invalid_token', 'WRONG_TOKEN'), false)) { - $isTokenExpire = true; - } else { - // handle other errors - $this->handleBitrix24APILevelErrors($requestResult, 'app.info'); + if (isset($requestResult['error'])) { + if (in_array($requestResult['error'], array('expired_token', 'invalid_token', 'WRONG_TOKEN'), false)) { + $isTokenExpire = true; + } else { + // handle other errors + $this->handleBitrix24APILevelErrors($requestResult, 'app.info'); + } } return $isTokenExpire; }// end of isTokenExpire @@ -1008,4 +1010,4 @@ public function getRetriesToConnectTimeout() { return $this->retriesToConnectTimeout; } -} \ No newline at end of file +}