* Fixes NB#100159, added a missing NULL check to fix a crash
[modest] / src / modest-ui-actions.c
index 8b387a8..df8fd8b 100644 (file)
@@ -5896,10 +5896,12 @@ do_headers_action (ModestWindow *win,
 
        /* Trick: do a poke status in order to speed up the signaling
           of observers */
 
        /* Trick: do a poke status in order to speed up the signaling
           of observers */
-       tny_folder_poke_status (folder);
+       if (folder) {
+               tny_folder_poke_status (folder);
+               g_object_unref (folder);
+       }
 
        /* Frees */
 
        /* Frees */
-       g_object_unref (folder);
        g_object_unref (iter);
        g_object_unref (headers_list);
 }
        g_object_unref (iter);
        g_object_unref (headers_list);
 }