Commit 293b8c8f authored by Leigh Stoller's avatar Leigh Stoller

Wrap decode_json() in an eval so it does not kill the daemon.

parent f337b9d4
......@@ -392,8 +392,11 @@ sub UpdateAggregateGraphs()
foreach my $file ($NOFED, $FEDONLY) {
if (-e $file) {
my $data = `/bin/cat $file`;
my $obj = decode_json($data);
if (!defined($obj)) {
my $obj = eval { decode_json($data); };
if ($@ || !defined($obj)) {
if ($@) {
print STDERR $@;
}
print STDERR "Could not decide json in $file\n";
next;
}
......
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