From 1c33530a870a1d96b46670ebe48953fb06347a40 Mon Sep 17 00:00:00 2001 From: Thomas Lackner Date: Thu, 3 Jan 2013 15:12:30 -0600 Subject: [PATCH] in the example script, exit early if the user has no snaps --- examples/fetch_all_new_photos.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/fetch_all_new_photos.php b/examples/fetch_all_new_photos.php index b0ad780..94d6420 100644 --- a/examples/fetch_all_new_photos.php +++ b/examples/fetch_all_new_photos.php @@ -24,6 +24,11 @@ $s = new Snaphax($opts); $result = $s->login(); var_dump($result); + if (empty($result) || empty($result['snaps'])) { + echo "no snaps"; + exit; + } + foreach ($result['snaps'] as $snap) { var_dump($snap['st']); if ($snap['st'] == SnapHax::STATUS_NEW) {