diff options
-rw-r--r-- | src/core/abstract/MCAddress.cpp | 6 | ||||
-rw-r--r-- | src/core/imap/MCIMAPSession.cpp | 11 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/core/abstract/MCAddress.cpp b/src/core/abstract/MCAddress.cpp index 335bc68b..505b064e 100644 --- a/src/core/abstract/MCAddress.cpp +++ b/src/core/abstract/MCAddress.cpp @@ -175,7 +175,11 @@ Array * Address::addressesWithRFC822String(String * string) struct mailimf_address_list * addr_list; Array * result; int r; - + + if (string == NULL) { + return NULL; + } + utf8String = string->UTF8Characters(); currentIndex = 0; diff --git a/src/core/imap/MCIMAPSession.cpp b/src/core/imap/MCIMAPSession.cpp index 4cfcfa95..4d23da60 100644 --- a/src/core/imap/MCIMAPSession.cpp +++ b/src/core/imap/MCIMAPSession.cpp @@ -644,11 +644,16 @@ void IMAPSession::connect(ErrorCode * pError) int r; setup(); - + MCLog("connect %s", MCUTF8DESC(this)); - + MCAssert(mState == STATE_DISCONNECTED); - + + if (mHostname == NULL) { + * pError = ErrorConnection; + goto close; + } + switch (mConnectionType) { case ConnectionTypeStartTLS: MCLog("STARTTLS connect"); |