php-snapchat
php-snapchat copied to clipboard
Error checking for Snapchat::$cache in getUpdates and getFriendStories
Snapchat::$cache can be null or not defined in getUpdates and getFriendStories, when login fails or after a logout.
Code to reproduce:
$snap = new Snapchat('gjdrglkmdr', 'gdkrweokew'); // invalid username and password combination
$snap->getUpdates();
outputs
PHP Notice: Undefined property: Snapchat::$cache in C:\Users\Gabriel\Documents\
GitHub\php-snapchat\src\snapchat.php on line 234
Notice: Undefined property: Snapchat::$cache in C:\Users\Gabriel\Documents\GitHu
b\php-snapchat\src\snapchat.php on line 234
PHP Fatal error: Call to a member function get() on a non-object in C:\Users\Ga
briel\Documents\GitHub\php-snapchat\snapchat.php on line 234
Fatal error: Call to a member function get() on a non-object in C:\Users\Gabriel
\Documents\GitHub\php-snapchat\src\snapchat.php on line 234