summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2015-11-03 00:45:13 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-11-03 00:45:13 +0000
commitff6c50f15b0bc02cdf69e874b405337f1dc052f6 (patch)
tree738319769a4ec99dd636347ab20c3a09ff6fabe8
parenta06142c3f22809266fc007d24cecd21ff27e0523 (diff)
parent4b936aaee0461b4c9205b4f3c0023f434bec25c0 (diff)
Don\'t try to iterate through empty cursor
am: 4b936aaee0 * commit '4b936aaee0461b4c9205b4f3c0023f434bec25c0': Don't try to iterate through empty cursor
-rw-r--r--src/com/android/dialer/filterednumber/FilteredNumbersUtil.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java b/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java
index a9bb98321..4cc8e7594 100644
--- a/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java
+++ b/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java
@@ -251,11 +251,11 @@ public class FilteredNumbersUtil {
boolean shouldBlock = false;
if (cursor != null) {
try {
- cursor.moveToFirst();
-
- // Block if number is found and it was added before this voicemail was received.
- final long numberBlockedTimeMs = cursor.getLong(0);
- shouldBlock = cursor.getCount() > 0 && voicemailDateMs > numberBlockedTimeMs;
+ if (cursor.moveToFirst()) {
+ // Block if number is found and it was added before this voicemail was received.
+ final long numberBlockedTimeMs = cursor.getLong(0);
+ shouldBlock = cursor.getCount() > 0 && voicemailDateMs > numberBlockedTimeMs;
+ }
} finally {
cursor.close();
}