diff options
author | Jay Shrauner <shrauner@google.com> | 2014-05-28 10:13:40 -0700 |
---|---|---|
committer | Jay Shrauner <shrauner@google.com> | 2014-05-28 10:38:58 -0700 |
commit | 757bdd39b79c38f1f7713aa16db95d8a8f5dc6da (patch) | |
tree | ea4ecadd5a9d39a8fd2c2296af329b5d1affe387 /src/com/android/dialer/CallDetailActivity.java | |
parent | db46eddd188635d5ee3d2b91fd2cc0514c9b703a (diff) |
Fix NPE in getCallLogEntryUris
Detect when the ids array (EXTRA_CALL_LOG_IDS) is not present.
Bug:15308670
Change-Id: Ibd0d025f1d160942fa5a61e210f5057d7f31b54d
Diffstat (limited to 'src/com/android/dialer/CallDetailActivity.java')
-rw-r--r-- | src/com/android/dialer/CallDetailActivity.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index decfe9bf1..098e9882e 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -398,14 +398,15 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware * If both are available, the data on the intent takes precedence. */ private Uri[] getCallLogEntryUris() { - Uri uri = getIntent().getData(); + final Uri uri = getIntent().getData(); if (uri != null) { // If there is a data on the intent, it takes precedence over the extra. return new Uri[]{ uri }; } - long[] ids = getIntent().getLongArrayExtra(EXTRA_CALL_LOG_IDS); - Uri[] uris = new Uri[ids.length]; - for (int index = 0; index < ids.length; ++index) { + final long[] ids = getIntent().getLongArrayExtra(EXTRA_CALL_LOG_IDS); + final int numIds = ids == null ? 0 : ids.length; + final Uri[] uris = new Uri[numIds]; + for (int index = 0; index < numIds; ++index) { uris[index] = ContentUris.withAppendedId(Calls.CONTENT_URI_WITH_VOICEMAIL, ids[index]); } return uris; |