Fixed a bug when configuration file is empty

This commit is contained in:
moudsen
2021-07-17 23:45:50 +02:00
committed by GitHub
parent 2882367308
commit 2976a4af9c

View File

@@ -27,7 +27,7 @@
$content = file_get_contents($argv[1]); $content = file_get_contents($argv[1]);
$data = json_decode($content,TRUE); $data = json_decode($content,TRUE);
if ($data==NULL) if (($data==NULL) && (sizeof($content)>2))
{ {
echo 'Invalid JSON format in config file?!'.$cCRLF; echo 'Invalid JSON format in config file?!'.$cCRLF;
die; die;
@@ -138,4 +138,4 @@
default: default:
echo 'Unknown command?'.$cCRLF; echo 'Unknown command?'.$cCRLF;
} }
?> ?>