Notify user, if the coordinates are invalid.

merge-requests/218/head
None 10 years ago
parent f3f36f8b20
commit 61b31e9b38
  1. 13
      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() {

Loading…
Cancel
Save