Skip to content

Commit 0274f6e

Browse files
Update docker/ui.php
Co-authored-by: qodo-merge-pro-for-open-source[bot] <189517486+qodo-merge-pro-for-open-source[bot]@users.noreply.github.com>
1 parent fe85a80 commit 0274f6e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docker/ui.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ function I(i){return document.getElementById(i);}
1414
if($mode=="standalone" || $mode=="backend"){ ?>
1515
var SPEEDTEST_SERVERS=[];
1616
<?php } elseif ($mode=="dual") {
17-
$servers = json_decode(file_get_contents('/servers.json'), true);
17+
$jsonContent = @file_get_contents('/servers.json');
18+
if ($jsonContent === false) {
19+
$servers = [];
20+
} else {
21+
$servers = json_decode($jsonContent, true) ?: [];
22+
}
1823

1924
// find out my own URL
2025
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";

0 commit comments

Comments
 (0)