Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit f99d066

Browse files
committed
🐛 Fix overlogging of non-errors in LocationGlobe
1 parent 72d8890 commit f99d066

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/classes/locationGlobe.class.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,16 @@ class LocationGlobe {
8181
res.on("end", () => {
8282
try {
8383
let json = JSON.parse(rawData);
84-
let lat = Number(json.geo.location.latitude);
85-
let lon = Number(json.geo.location.longitude);
86-
87-
window.mods.globe.conns.push({
88-
ip,
89-
pin: window.mods.globe.globe.addPin(lat, lon, "", 1.2),
90-
// marker: window.mods.globe.globe.addMarker(lat, lon, "", window.mods.globe._locMarker, 1, "transparent")
91-
});
84+
if (json.geo) {
85+
let lat = Number(json.geo.location.latitude);
86+
let lon = Number(json.geo.location.longitude);
87+
88+
window.mods.globe.conns.push({
89+
ip,
90+
pin: window.mods.globe.globe.addPin(lat, lon, "", 1.2),
91+
// marker: window.mods.globe.globe.addMarker(lat, lon, "", window.mods.globe._locMarker, 1, "transparent")
92+
});
93+
}
9294
} catch(e) {
9395
let electron = require("electron");
9496
electron.ipcRenderer.send("log", "note", "LocationGlobe: Error parsing data from ipinfo.now.sh");

0 commit comments

Comments
 (0)