From 14a20843e31e532c83c4290808549083648474bb Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 19 Jan 2011 00:57:12 +0000 Subject: [PATCH] Get rid of two potential null pointer access warnings --- src/com/fsck/k9/controller/MessagingController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index faa1c8f56..93a3c4d4e 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -4698,7 +4698,7 @@ public class MessagingController implements Runnable final KeyguardManager keyguardService = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); try { - if (message != null && message.getFrom() != null) + if (message.getFrom() != null) { Address[] fromAddrs = message.getFrom(); String from = fromAddrs.length > 0 ? fromAddrs[0].toFriendly().toString() : null; @@ -5146,7 +5146,7 @@ public class MessagingController implements Runnable try { LocalStore localStore = account.getLocalStore(); - localFolder= localStore.getFolder(remoteFolder.getName()); + localFolder = localStore.getFolder(remoteFolder.getName()); localFolder.open(OpenMode.READ_WRITE); account.setRingNotified(false); @@ -5178,7 +5178,10 @@ public class MessagingController implements Runnable String errorMessage = "Push failed: " + rootMessage; try { - localFolder.setStatus(errorMessage); + // Oddly enough, using a local variable gets rid of a + // potential null pointer access warning with Eclipse. + LocalFolder folder = localFolder; + folder.setStatus(errorMessage); } catch (Exception se) {