From: Michael Tremer Date: Sun, 8 Mar 2015 16:38:00 +0000 (+0100) Subject: freifunk.cgi: Catch JSON parsing errors and move on X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b0d6b06cd8ffdef606d822d8b41db5c19728f607;p=people%2Fms%2Fipfire-2.x.git freifunk.cgi: Catch JSON parsing errors and move on --- diff --git a/html/cgi-bin/freifunk.cgi b/html/cgi-bin/freifunk.cgi index a9b9d6ae32..1ee22d802d 100755 --- a/html/cgi-bin/freifunk.cgi +++ b/html/cgi-bin/freifunk.cgi @@ -355,7 +355,12 @@ sub LoadNetwork() { my $file = shift; if (-e $file) { - return JSON::Parse::json_file_to_perl($file); + my $ret = eval { + return JSON::Parse::json_file_to_perl($file); + } or do { + return undef; + }; + return $ret; } return undef;