From: gu.martinm@gmail.com Date: Fri, 4 Apr 2014 03:09:19 +0000 (+0200) Subject: No time for comments X-Git-Tag: weatherinformation-1.0~189 X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=0eb51ece667ee8228e8bc9e8515814709da74f3e;p=AndroidWeatherInformation No time for comments --- diff --git a/src/de/example/exampletdd/parser/JPOSWeatherParser.java b/src/de/example/exampletdd/parser/JPOSWeatherParser.java index ab23011..f92a2ef 100644 --- a/src/de/example/exampletdd/parser/JPOSWeatherParser.java +++ b/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,