* Extra check to fix a G_CRITICAL
[modest] / src / widgets / modest-header-view.c
index 2fd93ca..b13922b 100644 (file)
@@ -32,6 +32,7 @@
 #include <tny-simple-list.h>
 #include <tny-folder-monitor.h>
 #include <tny-folder-change.h>
+#include <tny-merge-folder.h>
 #include <tny-error.h>
 #include <string.h>
 
@@ -2204,8 +2205,8 @@ on_account_removed (TnyAccountStore *self,
 
        priv = MODEST_HEADER_VIEW_GET_PRIVATE (user_data);
 
-       if (priv->folder) {
-               TnyAccount *my_account;
+       if (priv->folder && !TNY_IS_MERGE_FOLDER (priv->folder)) {
+               TnyAccount *my_account = NULL;
 
                my_account = tny_folder_get_account (priv->folder);
                if (my_account == account)