summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlp Toker <alp@atoker.com>2006-08-26 19:58:52 +0100
committerAlp Toker <alp@atoker.com>2006-08-26 19:58:52 +0100
commita871a8128029698e9e789e1a00d0e6c5258d7873 (patch)
tree04437fb7fe7856a4939280b23c374f43b1846626
parentdf1f7fddb830558696973cbf3bdda26da48b7cdc (diff)
downloadcompiz-cil-a871a8128029698e9e789e1a00d0e6c5258d7873.tar.gz
compiz-cil-a871a8128029698e9e789e1a00d0e6c5258d7873.tar.bz2
Handle NULL strings gracefully
This avoids crashing when a requested plugin doesn't exist. Thanks to Miguel for noticing this.
-rw-r--r--glue/compiz-mono.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/glue/compiz-mono.c b/glue/compiz-mono.c
index f2ae108..d13e922 100644
--- a/glue/compiz-mono.c
+++ b/glue/compiz-mono.c
@@ -44,8 +44,8 @@ monoloaderLoadPlugin (CompPlugin *p, char *path, char *name)
gpointer params[3];
params[0] = &p;
- params[1] = (gpointer*) mono_string_new (data->domain, path);
- params[2] = (gpointer*) mono_string_new (data->domain, name);
+ params[1] = (path == NULL) ? NULL : (gpointer*) mono_string_new (data->domain, path);
+ params[2] = (name == NULL) ? NULL : (gpointer*) mono_string_new (data->domain, name);
MonoObject *mret = mono_runtime_invoke (method, data->loader_instance, params, NULL);
status = *(Bool*)mono_object_unbox(mret);