]> www.vanbest.org Git - tv_grab_nl_java/commitdiff
Fix null pointer exception in Horizon grabber
authorJan-Pascal van Best <janpascal@vanbest.org>
Tue, 14 Jan 2014 19:57:55 +0000 (20:57 +0100)
committerJan-Pascal van Best <janpascal@vanbest.org>
Tue, 14 Jan 2014 20:26:46 +0000 (21:26 +0100)
src/main/java/org/vanbest/xmltv/Horizon.java

index 8dec8ff7b5eaa7b537d6a33a0ac4c399aefcff67..a1c2b80550025f970938de4cb07525f39db4f756 100644 (file)
@@ -223,6 +223,8 @@ public class Horizon extends AbstractEPGSource implements EPGSource {
                        result.startTime = new Date(json.getLong("startTime"));
                        result.endTime = new Date(json.getLong("endTime"));
                        JSONObject prog = json.getJSONObject("program");
+                        // Sometimes the JSON doesnt contains a prog item
+                        if (prog==null || prog.isNullObject()) return result;
                        String title = null;
                        if (prog.has("title")){
                                title = prog.getString("title");