From 0eb51ece667ee8228e8bc9e8515814709da74f3e Mon Sep 17 00:00:00 2001 From: "gu.martinm@gmail.com" Date: Fri, 4 Apr 2014 05:09:19 +0200 Subject: [PATCH] No time for comments --- src/de/example/exampletdd/parser/JPOSWeatherParser.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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, -- 2.1.4