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();