Handle missing wind data in OpenWeather provider.

Fixes:
JS WARNING: [/usr/share/gnome-shell/extensions/openweather-extension@jenslody.de/openweathermap_org.js 381]: reference to undefined property "deg"
JS WARNING: [/usr/share/gnome-shell/extensions/openweather-extension@jenslody.de/extension.js 1171]: reference to undefined property "NaN"
merge-requests/227/head
Philippe Troin 6 years ago
parent 7ea4ce7a12
commit 7da9bb80dd
  1. 4
      src/openweathermap_org.js

@ -378,7 +378,11 @@ function parseWeatherCurrent() {
this._currentWeatherSunrise.text = sunrise;
this._currentWeatherSunset.text = sunset;
this._currentWeatherBuild.text = lastBuild;
if (json.wind != undefined && json.wind.deg != undefined) {
this._currentWeatherWind.text = this.formatWind(json.wind.speed, this.getWindDirection(json.wind.deg));
} else {
this._currentWeatherWind.text = _("?");
}
this.parseWeatherForecast();
this.recalcLayout();

Loading…
Cancel
Save