From f5c3db12de89365c6d52c6d75c7b684e2c0d16ff Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Thu, 1 Apr 2010 17:02:17 -0700 Subject: [PATCH] Fix NPE in resetVisibleLimits * resetVisibleLimits can be called via BootReceiver, which isn't in the Email app process, so it can (and apparently did) get a RemoteException * This causes the query to return null; we have to check for it or we get this NPE Bug: 2564904 Change-Id: I4b75e3c74ac7d1276f609f2fc957afdaa8da2f64 --- src/com/android/email/Controller.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/email/Controller.java b/src/com/android/email/Controller.java index 72656e345..29af7569f 100644 --- a/src/com/android/email/Controller.java +++ b/src/com/android/email/Controller.java @@ -488,7 +488,9 @@ public class Controller { } } } finally { - c.close(); + if (c != null) { + c.close(); + } } } }.start();