summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.cpp1
-rw-r--r--noncore/net/mail/pop3wrapper.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
index 2aaff30..72f3c36 100644
--- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
@@ -22,16 +22,17 @@ void POP3wrapper::pop3_progress( size_t current, size_t maximum )
void POP3wrapper::listMessages( QList<RecMail> &target )
{
int err = MAILPOP3_NO_ERROR;
char *header;
size_t length;
carray *messages;
login();
+ if (!m_pop3) return;
mailpop3_list( m_pop3, &messages );
for ( int i = carray_count( messages ); i > 0; i-- ) {
mailpop3_msg_info *info = (mailpop3_msg_info *) carray_get( messages, i - 1 );
err = mailpop3_header( m_pop3, info->index, &header, &length );
if ( err != MAILPOP3_NO_ERROR ) {
qDebug( "POP3: error retrieving header msgid: %i", info->index );
diff --git a/noncore/net/mail/pop3wrapper.cpp b/noncore/net/mail/pop3wrapper.cpp
index 2aaff30..72f3c36 100644
--- a/noncore/net/mail/pop3wrapper.cpp
+++ b/noncore/net/mail/pop3wrapper.cpp
@@ -22,16 +22,17 @@ void POP3wrapper::pop3_progress( size_t current, size_t maximum )
void POP3wrapper::listMessages( QList<RecMail> &target )
{
int err = MAILPOP3_NO_ERROR;
char *header;
size_t length;
carray *messages;
login();
+ if (!m_pop3) return;
mailpop3_list( m_pop3, &messages );
for ( int i = carray_count( messages ); i > 0; i-- ) {
mailpop3_msg_info *info = (mailpop3_msg_info *) carray_get( messages, i - 1 );
err = mailpop3_header( m_pop3, info->index, &header, &length );
if ( err != MAILPOP3_NO_ERROR ) {
qDebug( "POP3: error retrieving header msgid: %i", info->index );