Skip to content
Snippets Groups Projects
Commit 53b2cce4 authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

read_text dies if file does not exist; return undef instead

parent a2dd2625
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,16 @@ sub read_json_file
=end comment
=cut
my $json_text= read_text($fnm);
my $json_text;
eval
{
$json_text= read_text($fnm);
};
if ($@)
{
return undef;
}
from_json($json_text);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment