diff --git a/kmacctcachedimap.cpp b/kmacctcachedimap.cpp index ec21b8240..77a2a2ba2 100644 --- a/kmacctcachedimap.cpp +++ b/kmacctcachedimap.cpp @@ -210,7 +210,12 @@ void KMAcctCachedImap::processNewMail( bool /*interactive*/ ) else { KMFolder* f = mMailCheckFolders.front(); mMailCheckFolders.pop_front(); - processNewMail( static_cast( f->storage() ), false ); + + // Only check mail if the folder really exists, it might have been removed by the sync in + // the meantime. + if ( f ) { + processNewMail( static_cast( f->storage() ), false ); + } } }