Skip to content

Commit 9c82413

Browse files
steffenweberMinishlink
authored andcommitted
Fix "Uncaught Error: Call to a member function getStatusCode() on null" (#203)
The method "MessageSentReport::getStatusCode" now considers that its "response" property can be null (because Guzzle can return null when calling "RequestException::getResponse").
1 parent cfde4bd commit 9c82413

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/MessageSentReport.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ public function getEndpoint(): string {
109109
* @return bool
110110
*/
111111
public function isSubscriptionExpired(): bool {
112+
if (!$this->response) {
113+
return false;
114+
}
115+
112116
return \in_array($this->response->getStatusCode(), [404, 410], true);
113117
}
114118

0 commit comments

Comments
 (0)