diff options
author | Christian Mehlmauer <FireFart@gmail.com> | 2010-06-09 00:09:01 +0200 |
---|---|---|
committer | Christian Mehlmauer <FireFart@gmail.com> | 2010-06-09 00:09:01 +0200 |
commit | 9a319f5523517e9379b45f14692e7fc8f85c145f (patch) | |
tree | 401fa457330c2d9855ee0ac5974ad102332cb6c6 | |
parent | 4ce500bd7d08eac3f05dfd50bce51e620fa9f08e (diff) | |
download | Calendar-9a319f5523517e9379b45f14692e7fc8f85c145f.tar.gz |
Fixed a npe in Calendar on Emulator
This happened when working in the emulator. Open the calendar,
add a new Event with standard values (only enter a description)
and click done. A new Notification will pop up with this newly
created event. Click on it, and then on the Eventdetail.
A NPE will occur, because the mCalendarOwnerAccount seems to
be null in the emulator. Now the variable is reset to ""
if it is null (like the initial value). When there are attempts
to save this variable, there's already a check if != "", so it will
not be stored. The other calls to this variable are only .equals()
Change-Id: I0a27547a3849c260d12310771992df496d3b2e94
-rw-r--r-- | src/com/android/calendar/EventInfoActivity.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/calendar/EventInfoActivity.java b/src/com/android/calendar/EventInfoActivity.java index aec7953a..33712148 100644 --- a/src/com/android/calendar/EventInfoActivity.java +++ b/src/com/android/calendar/EventInfoActivity.java @@ -329,7 +329,8 @@ public class EventInfoActivity extends Activity implements View.OnClickListener, mCalendarOwnerAccount = ""; if (mCalendarsCursor != null) { mCalendarsCursor.moveToFirst(); - mCalendarOwnerAccount = mCalendarsCursor.getString(CALENDARS_INDEX_OWNER_ACCOUNT); + String tempAccount = mCalendarsCursor.getString(CALENDARS_INDEX_OWNER_ACCOUNT); + mCalendarOwnerAccount = (tempAccount == null) ? "" : tempAccount; } String eventOrganizer = mEventCursor.getString(EVENT_INDEX_ORGANIZER); mIsOrganizer = mCalendarOwnerAccount.equals(eventOrganizer); |