diff --git a/php/change.php b/php/change.php index 4986e1b4..47fd8526 100755 --- a/php/change.php +++ b/php/change.php @@ -20,12 +20,12 @@ $np = array_values($np); $firstSong = array_values($songs); $save = false; //declares the save variable, see further down for why -try{ +if(is_array($data["conf"]["views"])){ if(!in_array($guid, $data["conf"]["views"])){ //add viewer in viewers if not already in there array_push($data["conf"]["views"], $guid); file_put_contents($list, json_encode($data)); } -}catch(Exception $e){ +}else{ $data["conf"]["views"]=array($guid); file_put_contents($list, json_encode($data)); }