Commit 217e4e30 authored by Gavin Brown's avatar Gavin Brown

wrap from_json in eval to catch errors

parent eecfaabc
......@@ -88,7 +88,9 @@ syslog(LOG_DEBUG, "done");
sub parse_json {
my $json = shift;
my $data = from_json($json);
my $data;
eval { $data = from_json($json); };
return undef if (!$data || $@);
$data->{'start'} = strftime($datefmt, localtime($data->{'start'}));
$data->{'end'} = strftime($datefmt, localtime($data->{'end'}));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment