Weather updates

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-09-02 13:34:12 -04:00
parent b6bc22ae63
commit 3c47375229
7 changed files with 47 additions and 13 deletions

View File

@@ -53,12 +53,18 @@ namespace MediaBrowser.Controller.Weather
{
WeatherInfo info = new WeatherInfo();
if (data.current_condition.Any())
if (data.current_condition != null)
{
info.CurrentWeather = data.current_condition.First().ToWeatherStatus();
if (data.current_condition.Any())
{
info.CurrentWeather = data.current_condition.First().ToWeatherStatus();
}
}
info.Forecasts = data.weather.Select(w => w.ToWeatherForecast()).ToArray();
if (data.weather != null)
{
info.Forecasts = data.weather.Select(w => w.ToWeatherForecast()).ToArray();
}
return info;
}