diff --git a/src/extension.js b/src/extension.js index 3a5118a..77dff4b 100644 --- a/src/extension.js +++ b/src/extension.js @@ -880,12 +880,17 @@ const OpenweatherMenuButton = new Lang.Class({ }, extractCoord: function() { - if (!arguments[0]) - return 0; + let coords = 0; - if (arguments[0].search(">") == -1) + if (arguments[0] && (arguments[0].search(">") != -1)) + coords = arguments[0].split(">")[0]; + + if ((coords.search(",") == -1) || isNaN(coords.split(",")[0]) || isNaN(coords.split(",")[1])) { + Main.notify("Openweathermap", _("Invalid location, please try to recreate it")); return 0; - return arguments[0].split(">")[0]; + } + + return coords; }, _onPreferencesActivate: function() {