From 1366a4bd9543d31fcd1356f7b50e6888af952276 Mon Sep 17 00:00:00 2001 From: mgp25 Date: Mon, 7 Sep 2015 09:49:34 +0200 Subject: [PATCH] Fixes #186 --- src/snapchat.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/snapchat.php b/src/snapchat.php index 24db518..7382411 100644 --- a/src/snapchat.php +++ b/src/snapchat.php @@ -1913,9 +1913,11 @@ function writeToFile($path, $data) { $newFile = $path . $ext; rename($path, $newFile); - } - return $newFile; + return $newFile + } + else + return false; } /** @@ -2647,7 +2649,8 @@ public function getStory($media_id, $key, $iv, $from, $timestamp, $save = FALSE, if(!file_exists($file)) { $newFile = $this->writeToFile($file, $value); - $files[] = $newFile; + if($newFile) + $files[] = $newFile; } } $output = array();