From: gu.martinm@gmail.com Date: Fri, 4 Apr 2014 03:09:19 +0000 (+0200) Subject: No time for comments X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=f2feef2f79400016241b5310e854a7236ba5d90c;p=JavaForFun No time for comments --- diff --git a/Android/WeatherInformation/src/de/example/exampletdd/parser/JPOSWeatherParser.java b/Android/WeatherInformation/src/de/example/exampletdd/parser/JPOSWeatherParser.java index ab23011..f92a2ef 100644 --- a/Android/WeatherInformation/src/de/example/exampletdd/parser/JPOSWeatherParser.java +++ b/Android/WeatherInformation/src/de/example/exampletdd/parser/JPOSWeatherParser.java @@ -39,8 +39,14 @@ public class JPOSWeatherParser implements IJPOSWeatherParser { jsonObject = jsonWeatherData.getJSONObject("main"); final double temp = jsonObject.getDouble("temp"); - final double minTemp = jsonObject.getDouble("temp_min"); - final double maxTemp = jsonObject.getDouble("temp_max"); + double minTemp = 0; + try { + minTemp = jsonObject.getDouble("temp_min"); + } catch (final JSONException e) {} + double maxTemp = 0; + try { + maxTemp = jsonObject.getDouble("temp_max"); + } catch (final JSONException e) {} final double humidity = jsonObject.getDouble("humidity"); final double pressure = jsonObject.getDouble("pressure"); final WeatherData.Main main = new WeatherData.Main(temp, minTemp,