diff --git a/src/snapchat.php b/src/snapchat.php index 14901a3..4597bec 100644 --- a/src/snapchat.php +++ b/src/snapchat.php @@ -874,7 +874,9 @@ public function sendMessage($tos, $text){ public function getConversations() { $updates = $this->getUpdates(); - $offset = end($updates['data']->conversations_response)->iter_token; + $last = end($updates['data']->conversations_response); + if (isset($last->iter_token)) + $offset = $last->iter_token; $convos = $updates['data']->conversations_response; while(strlen($offset) > 0){ $timestamp = parent::timestamp();