Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

Commit 11d5352

Browse files
committed
fix possible NPE if SASL is enabled on Android - bug 7512
1 parent 9197c43 commit 11d5352

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

doc/release/CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ K 7378 Deadlock in IMAPFolder.doProtocolCommand()
3232
K 7471 InternetAddress.getLocalAddress should use
3333
InetAddress.getCanonicalHostName
3434
K 7472 Store finalizers should not talk to server
35+
K 7512 NullPointerException if SASL is enabled on Android
3536

3637

3738
CHANGES IN THE 1.5.5 RELEASE

mail/src/main/java/com/sun/mail/imap/IMAPStore.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,9 @@ protected IMAPStore(Session session, URLName url,
720720
if (protocol != null)
721721
protocol.disconnect();
722722
protocol = null;
723+
Response r = cex.getResponse();
723724
throw new AuthenticationFailedException(
724-
cex.getResponse().getRest());
725+
r != null ? r.getRest() : cex.getMessage());
725726
} catch (ProtocolException pex) { // any other exception
726727
// failure in login command, close connection to server
727728
if (protocol != null)

0 commit comments

Comments
 (0)