summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2014-04-18 15:07:18 +0800
committerAdnan <adnan@cyngn.com>2014-08-26 14:46:52 -0700
commit4c4689eff040e7233a290bd22cf73655f4a1f68b (patch)
tree45de517aba7d61e9c651ae72b8e778aedab8221f
parent65103be4e734d0a0b073afa639e451ada8703e5b (diff)
downloadandroid_packages_apps_Calendar-4c4689eff040e7233a290bd22cf73655f4a1f68b.tar.gz
android_packages_apps_Calendar-4c4689eff040e7233a290bd22cf73655f4a1f68b.tar.bz2
android_packages_apps_Calendar-4c4689eff040e7233a290bd22cf73655f4a1f68b.zip
Calendar: Check if the duration is empty before parser it when delete the events
If the event end time is 0, it will calculate the end time by "duration" string. But if the "duration" is null, it will lead the NullPointerException. So check the duration string is empty or not before use it to get the end time when delete the events. CRs-Fixed: 650814 Change-Id: I97350db4103959b851367beae53f09200a2a29b8
-rw-r--r--src/com/android/calendar/DeleteEventsActivity.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/com/android/calendar/DeleteEventsActivity.java b/src/com/android/calendar/DeleteEventsActivity.java
index f763675c..02a597e5 100644
--- a/src/com/android/calendar/DeleteEventsActivity.java
+++ b/src/com/android/calendar/DeleteEventsActivity.java
@@ -315,12 +315,15 @@ public class DeleteEventsActivity extends ListActivity
// if DTEND invalid, check for duration
if (end == 0) {
String durationStr = cursor.getString(cursor.getColumnIndex(Events.DURATION));
- Duration duration = new Duration();
- try {
- duration.parse(durationStr);
- end = start + duration.getMillis();
- } catch (DateException e) {
- Log.w(TAG, e.getLocalizedMessage());
+ if (durationStr != null) {
+ Duration duration = new Duration();
+
+ try {
+ duration.parse(durationStr);
+ end = start + duration.getMillis();
+ } catch (DateException e) {
+ Log.w(TAG, e.getLocalizedMessage());
+ }
}
}
if (DEBUG) Log.v(TAG,