0.9.5claws30
authorChristoph Hohmann <reboot@gmx.ch>
Fri, 26 Sep 2003 09:34:26 +0000 (09:34 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Fri, 26 Sep 2003 09:34:26 +0000 (09:34 +0000)
* src/folder.c
* src/msgcache.c
        add more NULL pointer checks

ChangeLog.claws
configure.ac
src/folder.c
src/msgcache.c

index b48dc87..61527f8 100644 (file)
@@ -1,3 +1,9 @@
+2003-09-26 [christoph] 0.9.5claws30
+
+       * src/folder.c
+       * src/msgcache.c
+               add more NULL pointer checks
+
 2003-09-25 [christoph] 0.9.5claws29
 
        * src/folder.c
index 8541471..5ac091c 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=29
+EXTRA_VERSION=30
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 2168924..236dd35 100644 (file)
@@ -1573,6 +1573,7 @@ MsgInfo *folder_item_get_msginfo_by_msgid(FolderItem *item, const gchar *msgid)
        MsgInfo *msginfo;
        
        g_return_val_if_fail(item != NULL, NULL);
+       g_return_val_if_fail(msgid != NULL, NULL);
        
        folder = item->folder;
        if (!item->cache)
@@ -2031,14 +2032,20 @@ static gint do_copy_msgs(FolderItem *dest, GSList *msglist, gboolean remove_sour
                        MsgInfo *newmsginfo;
 
                        if (folderscan) {
-                               newmsginfo = folder_item_get_msginfo_by_msgid(dest, msginfo->msgid);
-                               copy_msginfo_flags(msginfo, newmsginfo);
-                               num = newmsginfo->msgnum;
-                               procmsg_msginfo_free(newmsginfo);                               
+                               if (msginfo->msgid != NULL) {
+                                       newmsginfo = folder_item_get_msginfo_by_msgid(dest, msginfo->msgid);
+                                       if (newmsginfo != NULL) {
+                                               copy_msginfo_flags(msginfo, newmsginfo);
+                                               num = newmsginfo->msgnum;
+                                               procmsg_msginfo_free(newmsginfo);
+                                       }
+                               }
                        } else {
                                newmsginfo = folder->klass->get_msginfo(folder, dest, num);
-                               add_msginfo_to_cache(dest, newmsginfo, msginfo);
-                               procmsg_msginfo_free(newmsginfo);
+                               if (newmsginfo != NULL) {
+                                       add_msginfo_to_cache(dest, newmsginfo, msginfo);
+                                       procmsg_msginfo_free(newmsginfo);
+                               }
                        }
 
                        if (num > lastnum)
index 3fd6bc3..7e5c3b3 100644 (file)
@@ -434,6 +434,7 @@ MsgInfo *msgcache_get_msg_by_id(MsgCache *cache, const gchar *msgid)
        MsgInfo *msginfo;
        
        g_return_val_if_fail(cache != NULL, NULL);
+       g_return_val_if_fail(msgid != NULL, NULL);
 
        msginfo = g_hash_table_lookup(cache->msgid_table, msgid);
        if(!msginfo)