Yi EungJun 2015-01-29
Mailbox: Fix NPE when stop the service which didn't start
Do not stop the service if it didn't start.
@5919a57f301585124b63425645a49b3c252fd58e
app/mailbox/MailboxService.java
--- app/mailbox/MailboxService.java
+++ app/mailbox/MailboxService.java
@@ -128,7 +128,13 @@
      * Stop MailboxService.
      */
     public void stop() {
+        if (folder == null && store == null && pollingSchedule == null) {
+            // We don't need to stop the Mailbox Service which didn't start.
+            return;
+        }
+
         isStopping = true;
+
         try {
             folder.close(true);
             store.close();
Add a comment
List