ensure minimal forecastConditionType lenght for weather notifications

This commit is contained in:
vanous 2020-12-25 20:25:46 +01:00 committed by Gitea
parent 09eb470b64
commit f1d83670d0

View File

@ -83,7 +83,7 @@ public class ParcelableWeather2 implements Parcelable {
Bundle forecastBundle = in.readBundle(getClass().getClassLoader()); Bundle forecastBundle = in.readBundle(getClass().getClassLoader());
String[] forecastConditionType = forecastBundle.getStringArray("weather_condition_types"); String[] forecastConditionType = forecastBundle.getStringArray("weather_condition_types");
int forecastConditionCode = 0; int forecastConditionCode = 0;
if (forecastConditionType != null) { if (forecastConditionType != null && forecastConditionType.length > 0) {
forecastConditionCode = weatherConditionTypesToOpenWeatherMapIds(forecastConditionType[0]); forecastConditionCode = weatherConditionTypesToOpenWeatherMapIds(forecastConditionType[0]);
} }
int forecastLowTemp = forecastBundle.getInt("weather_low_temp"); int forecastLowTemp = forecastBundle.getInt("weather_low_temp");