Added safety to the loadServers.js

This commit is contained in:
Mathias Wagner
2023-11-30 12:11:55 +01:00
parent 96769fa6df
commit dd4b43d002
@@ -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)";
});