Null check cursor

Mock provider is returning null on this query in testing.

b/12085240

Change-Id: Ifa5edc03707a6050acdbd5184a44409d46004e7e
This commit is contained in:
Tony Mantler 2013-12-13 13:44:05 -08:00
parent 05723aa0f6
commit b9d071a493

View File

@ -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 {