aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-folder.c')
-rw-r--r--camel/camel-folder.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 5097caa295..0e2a234d06 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -274,6 +274,13 @@ _open (CamelFolder *folder,
CamelFolderOpenMode mode,
CamelException *ex)
{
+ if (folder->open_state == FOLDER_OPEN) {
+ camel_exception_set (ex,
+ CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
+ "folder is already open");
+ return;
+ }
+
folder->open_state = FOLDER_OPEN;
folder->open_mode = mode;
}
@@ -1397,7 +1404,7 @@ GList *camel_folder_search_by_expression (CamelFolder *folder,
CamelException *ex)
{
g_assert (folder != NULL);
- g_assert (folder->has_search_capability);
+ g_return_val_if_fail (folder->has_search_capability, NULL);
return CF_CLASS (folder)->search_by_expression (folder, expression, ex);
}