From 6c9678dd3ee72153a2008969f802224ee1a63b0c Mon Sep 17 00:00:00 2001 From: EddyVerbruggen Date: Sun, 31 Aug 2014 15:09:23 +0200 Subject: [PATCH] #92 deal with null params --- plugin.xml | 2 +- src/android/nl/xservices/plugins/Calendar.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin.xml b/plugin.xml index 24448bab..73619f71 100644 --- a/plugin.xml +++ b/plugin.xml @@ -3,7 +3,7 @@ xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="nl.x-services.plugins.calendar" - version="4.2.5"> + version="4.2.6"> Calendar diff --git a/src/android/nl/xservices/plugins/Calendar.java b/src/android/nl/xservices/plugins/Calendar.java index 54387f92..16c0dc06 100644 --- a/src/android/nl/xservices/plugins/Calendar.java +++ b/src/android/nl/xservices/plugins/Calendar.java @@ -163,8 +163,8 @@ private boolean findEvents(JSONArray args) { try { JSONObject jsonFilter = args.getJSONObject(0); JSONArray jsonEvents = getCalendarAccessor().findEvents( - jsonFilter.optString("title"), - jsonFilter.optString("location"), + jsonFilter.isNull("title") ? null : jsonFilter.optString("title"), + jsonFilter.isNull("location") ? null : jsonFilter.optString("location"), jsonFilter.optLong("startTime"), jsonFilter.optLong("endTime"));