aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/camel-pgp-context.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/camel/camel-pgp-context.c b/camel/camel-pgp-context.c
index d6a725458a..cd3a7bee18 100644
--- a/camel/camel-pgp-context.c
+++ b/camel/camel-pgp-context.c
@@ -144,8 +144,9 @@ camel_pgp_context_new (CamelSession *session, CamelPgpType type, const char *pat
CamelPgpContext *context;
g_return_val_if_fail (session != NULL, NULL);
- g_return_val_if_fail (type != CAMEL_PGP_TYPE_NONE, NULL);
- g_return_val_if_fail (path != NULL, NULL);
+
+ if (type == CAMEL_PGP_TYPE_NONE || !path || !*path)
+ return NULL;
context = CAMEL_PGP_CONTEXT (camel_object_new (CAMEL_PGP_CONTEXT_TYPE));