diff options
author | Garrett Regier <garrettregier@gmail.com> | 2015-11-20 03:11:03 -0800 |
---|---|---|
committer | Garrett Regier <garrettregier@gmail.com> | 2015-12-15 16:57:46 -0800 |
commit | 57d82ee7f8aff6c743d41bda778531111215f54d (patch) | |
tree | 68b12e8be6c3ddbdbe45edc72723978b2709fb51 /libpeas | |
parent | d3db313b4fb019071a496ef77062ffedfcb99211 (diff) | |
download | libpeas-57d82ee7f8aff6c743d41bda778531111215f54d.tar.gz |
Add various checks to PeasObjectModule functions
Diffstat (limited to 'libpeas')
-rw-r--r-- | libpeas/peas-object-module.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libpeas/peas-object-module.c b/libpeas/peas-object-module.c index ec9fa17..2c4a2f1 100644 --- a/libpeas/peas-object-module.c +++ b/libpeas/peas-object-module.c @@ -336,6 +336,9 @@ peas_object_module_new (const gchar *module_name, const gchar *path, gboolean resident) { + g_return_val_if_fail (module_name != NULL && *module_name != '\0', NULL); + g_return_val_if_fail (path != NULL && *path != '\0', NULL); + return PEAS_OBJECT_MODULE (g_object_new (PEAS_TYPE_OBJECT_MODULE, "module-name", module_name, "path", path, @@ -362,6 +365,9 @@ peas_object_module_new_full (const gchar *module_name, gboolean resident, gboolean local_linkage) { + g_return_val_if_fail (module_name != NULL && *module_name != '\0', NULL); + g_return_val_if_fail (path != NULL && *path != '\0', NULL); + return PEAS_OBJECT_MODULE (g_object_new (PEAS_TYPE_OBJECT_MODULE, "module-name", module_name, "path", path, @@ -396,6 +402,9 @@ peas_object_module_create_object (PeasObjectModule *module, g_return_val_if_fail (PEAS_IS_OBJECT_MODULE (module), NULL); + if (interface != PEAS_TYPE_PLUGIN_LOADER) + g_return_val_if_fail (G_TYPE_IS_INTERFACE (interface), NULL); + impls = (InterfaceImplementation *) priv->implementations->data; for (i = 0; i < priv->implementations->len; ++i) if (impls[i].iface_type == interface) @@ -423,6 +432,9 @@ peas_object_module_provides_object (PeasObjectModule *module, g_return_val_if_fail (PEAS_IS_OBJECT_MODULE (module), FALSE); + if (interface != PEAS_TYPE_PLUGIN_LOADER) + g_return_val_if_fail (G_TYPE_IS_INTERFACE (interface), FALSE); + impls = (InterfaceImplementation *) priv->implementations->data; for (i = 0; i < priv->implementations->len; ++i) if (impls[i].iface_type == interface) |