mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-12 06:08:25 -05:00
Get rid of two potential null pointer access warnings
This commit is contained in:
parent
365b106753
commit
14a20843e3
@ -4698,7 +4698,7 @@ public class MessagingController implements Runnable
|
|||||||
final KeyguardManager keyguardService = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
|
final KeyguardManager keyguardService = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (message != null && message.getFrom() != null)
|
if (message.getFrom() != null)
|
||||||
{
|
{
|
||||||
Address[] fromAddrs = message.getFrom();
|
Address[] fromAddrs = message.getFrom();
|
||||||
String from = fromAddrs.length > 0 ? fromAddrs[0].toFriendly().toString() : null;
|
String from = fromAddrs.length > 0 ? fromAddrs[0].toFriendly().toString() : null;
|
||||||
@ -5146,7 +5146,7 @@ public class MessagingController implements Runnable
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
LocalStore localStore = account.getLocalStore();
|
LocalStore localStore = account.getLocalStore();
|
||||||
localFolder= localStore.getFolder(remoteFolder.getName());
|
localFolder = localStore.getFolder(remoteFolder.getName());
|
||||||
localFolder.open(OpenMode.READ_WRITE);
|
localFolder.open(OpenMode.READ_WRITE);
|
||||||
|
|
||||||
account.setRingNotified(false);
|
account.setRingNotified(false);
|
||||||
@ -5178,7 +5178,10 @@ public class MessagingController implements Runnable
|
|||||||
String errorMessage = "Push failed: " + rootMessage;
|
String errorMessage = "Push failed: " + rootMessage;
|
||||||
try
|
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)
|
catch (Exception se)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user