- /* Get the folder view */
- folder_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW(win),
- MODEST_WIDGET_TYPE_FOLDER_VIEW);
-
- /* Get header view */
- header_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW(win),
+ if (MODEST_IS_MAIN_WINDOW (win)) {
+ /* Get the folder view */
+ folder_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW(win),
+ MODEST_WIDGET_TYPE_FOLDER_VIEW);
+
+ /* Get header view */
+ header_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW(win),