[libpeas] Fix warning when an extension is not implemented in a C plugin



commit 87c4cfdd747f7f2b741ab26a97d3cd6d461c81aa
Author: Steve Frécinaux <code istique net>
Date:   Sun Jun 27 16:16:46 2010 +0200

    Fix warning when an extension is not implemented in a C plugin
    
    We used to erroneously display an error in that case because we asserted
    the object created from the extension gtype should not be NULL.

 loaders/c/peas-plugin-loader-c.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/loaders/c/peas-plugin-loader-c.c b/loaders/c/peas-plugin-loader-c.c
index 5fc3112..eee59d5 100644
--- a/loaders/c/peas-plugin-loader-c.c
+++ b/loaders/c/peas-plugin-loader-c.c
@@ -119,7 +119,14 @@ peas_plugin_loader_c_get_extension (PeasPluginLoader *loader,
 
   instance = peas_object_module_create_object (module, exten_type);
 
-  g_return_val_if_fail (instance != NULL, NULL);
+  if (instance == NULL)
+    {
+      g_debug ("Plugin '%s' doesn't provide a '%s' extension",
+               peas_plugin_info_get_module_name (info),
+               g_type_name (exten_type));
+      return NULL;
+    }
+
   g_return_val_if_fail (G_IS_OBJECT (instance), NULL);
   g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (instance, exten_type), NULL);
 



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