fix: do not crash if disk_check_exclude.txt is not created yet

This commit is contained in:
frederik
2024-05-15 09:28:25 +02:00
parent 43fcc09f4f
commit 6e6e9eab08
+2
View File
@@ -524,6 +524,8 @@ echo "<table>
$fp = @fopen($home."/BirdNET-Pi/scripts/disk_check_exclude.txt", 'r'); $fp = @fopen($home."/BirdNET-Pi/scripts/disk_check_exclude.txt", 'r');
if ($fp) { if ($fp) {
$disk_check_exclude_arr = explode("\n", fread($fp, filesize($home."/BirdNET-Pi/scripts/disk_check_exclude.txt"))); $disk_check_exclude_arr = explode("\n", fread($fp, filesize($home."/BirdNET-Pi/scripts/disk_check_exclude.txt")));
} else {
$disk_check_exclude_arr = [];
} }
if($config["FULL_DISK"] == "purge") { if($config["FULL_DISK"] == "purge") {