Index: camel/providers/imap/ChangeLog
===================================================================
--- camel/providers/imap/ChangeLog	(revision 9761)
+++ camel/providers/imap/ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2008-11-18  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #544438
+
+	* camel-imap-folder.c: (imap_expunge): Check for NULL before using it.
+
 2008-11-07  Srinivasa Ragavan  <sragavan@novell.com>
 
 	** Fix for bug #558883
Index: camel/providers/imap/camel-imap-folder.c
===================================================================
--- camel/providers/imap/camel-imap-folder.c	(revision 9761)
+++ camel/providers/imap/camel-imap-folder.c	(working copy)
@@ -1588,6 +1588,10 @@ imap_expunge (CamelFolder *folder, Camel
 	camel_folder_summary_save_to_db (folder->summary, ex);
 	uids = camel_db_get_folder_deleted_uids (folder->parent_store->cdb_r, folder->full_name, ex);
 
+	/* is NULL when have nothing to expunge */
+	if (!uids)
+		return;
+
 	if (CAMEL_OFFLINE_STORE (store)->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL)
 		imap_expunge_uids_online (folder, uids, ex);
 	else
