Fix an NPE in sendCommandInternal

b/13929234

Change-Id: I362682bde3c24123178e68811604f0180c853598
This commit is contained in:
Martin Hibdon 2014-04-09 11:22:52 -07:00
parent 84366ae273
commit 2a7411b57b
1 changed files with 3 additions and 1 deletions

View File

@ -280,6 +280,9 @@ class ImapConnection {
String sendCommandInternal(String command, boolean sensitive)
throws MessagingException, IOException {
if (mTransport == null) {
throw new IOException("Null transport");
}
String tag = Integer.toString(mNextCommandTag.incrementAndGet());
String commandToSend = tag + " " + command;
mTransport.writeLine(commandToSend, sensitive ? IMAP_REDACTED_LOG : null);
@ -287,7 +290,6 @@ class ImapConnection {
return tag;
}
/**
* Send a single, complex command to the server. The command will be preceded by an IMAP
* command tag and followed by \r\n (caller need not supply them). After each piece of the