- /* Do not allow to move the msg to the same folder */
- /* Do not allow to move the msg to an account */
- if ((gpointer) src_folder == (gpointer) folder_store ||
- TNY_IS_ACCOUNT (folder_store))
- ok_sensitive = FALSE;
- g_object_unref (src_folder);
+ if (TNY_IS_FOLDER(src_folder)) {
+ /* Do not allow to move the msg to the same folder */
+ /* Do not allow to move the msg to an account */
+ if ((gpointer) src_folder == (gpointer) folder_store ||
+ TNY_IS_ACCOUNT (folder_store))
+ ok_sensitive = FALSE;
+ g_object_unref (src_folder);
+ } else
+ g_warning ("%s: could not get source folder", __FUNCTION__);