mirror of
https://github.com/gnmyt/myspeed.git
synced 2026-05-03 18:39:49 -05:00
Added safety to the loadServers.js
This commit is contained in:
@@ -7,7 +7,7 @@ if (!fs.existsSync("data/servers.json")) {
|
||||
axios.get("https://www.speedtest.net/api/js/servers?limit=20")
|
||||
.then(res => res.data)
|
||||
.then(data => {
|
||||
data.forEach(row => {
|
||||
data?.forEach(row => {
|
||||
servers[row.id] = row.name + " (" + row.distance + "km)";
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user