From b9d071a493bae6caa22bf9c46abcdae26c7ca9f7 Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Fri, 13 Dec 2013 13:44:05 -0800 Subject: [PATCH] Null check cursor Mock provider is returning null on this query in testing. b/12085240 Change-Id: Ifa5edc03707a6050acdbd5184a44409d46004e7e --- src/com/android/email2/ui/MailActivityEmail.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/email2/ui/MailActivityEmail.java b/src/com/android/email2/ui/MailActivityEmail.java index 8868c04e2..bf78ce4e9 100644 --- a/src/com/android/email2/ui/MailActivityEmail.java +++ b/src/com/android/email2/ui/MailActivityEmail.java @@ -115,7 +115,7 @@ public class MailActivityEmail extends com.android.mail.ui.MailActivity { Account.CONTENT_URI, Account.ID_PROJECTION, null, null, null); - boolean enable = c.getCount() > 0; + boolean enable = c != null && c.getCount() > 0; setServicesEnabled(context, enable); return enable; } finally {