[evolution-data-server] CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT: Handle NULL gracefully.



commit cfd18887c45bef066daf833c9086e230789af526
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Jun 22 09:25:24 2012 -0400

    CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT: Handle NULL gracefully.
    
    Evaluates to FALSE if the 'provider' pointer is NULL.

 camel/camel-provider.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/camel/camel-provider.h b/camel/camel-provider.h
index 571e5f9..73e0c74 100644
--- a/camel/camel-provider.h
+++ b/camel/camel-provider.h
@@ -96,7 +96,10 @@ typedef enum {
 	CAMEL_URL_PATH_IS_ABSOLUTE = 1 << 31,
 } CamelProviderURLFlags;
 
-#define CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT(prov) (prov->object_types[CAMEL_PROVIDER_STORE] && prov->object_types[CAMEL_PROVIDER_TRANSPORT])
+#define CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT(provider) \
+	((provider != NULL) && \
+	((provider->object_types[CAMEL_PROVIDER_STORE] != G_TYPE_INVALID) && \
+	((provider->object_types[CAMEL_PROVIDER_TRANSPORT] != G_TYPE_INVALID)
 
 /* Generic extra config stuff */
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]