Fix "function sometimes returns no value"-issue

yahoo_weather
Jens Lody 11 years ago
parent aff288ab08
commit dda527ec38
  1. 6
      src/extension.js

@ -581,7 +581,7 @@ const WeatherMenuButton = new Lang.Class({
if(typeof city == "object" && typeof city.results == "object") if(typeof city == "object" && typeof city.results == "object")
city = city.results.place; city = city.results.place;
else else
return 0; return;
let cityText = city.woeid+">"+city.name; let cityText = city.woeid+">"+city.name;
if(city.admin1) if(city.admin1)
cityText += ", "+city.admin1.content; cityText += ", "+city.admin1.content;
@ -997,7 +997,7 @@ const WeatherMenuButton = new Lang.Class({
if(!message.response_body.data) if(!message.response_body.data)
{ {
fun.call(here,0); fun.call(here,0);
return 0; return;
} }
try try
@ -1008,7 +1008,7 @@ const WeatherMenuButton = new Lang.Class({
catch(e) catch(e)
{ {
fun.call(here,0); fun.call(here,0);
return 0; return;
} }
}); });
return 0; return 0;

Loading…
Cancel
Save