aboutsummaryrefslogtreecommitdiff
path: root/libindicator
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-10-08 19:12:47 -0400
committerTed Gould <ted@canonical.com>2009-10-08 19:12:47 -0400
commitb2942d9cc8631275fe8abdc53bd518b5b9f9ffcc (patch)
tree95777d054eacb04e7e2487baffad58d49686ddb9 /libindicator
parent18f63963ad625504956f753677927bda0e83d0dc (diff)
downloadlibayatana-indicator-b2942d9cc8631275fe8abdc53bd518b5b9f9ffcc.tar.gz
libayatana-indicator-b2942d9cc8631275fe8abdc53bd518b5b9f9ffcc.tar.bz2
libayatana-indicator-b2942d9cc8631275fe8abdc53bd518b5b9f9ffcc.zip
Checking to see if a file exists before trying to load it.
Diffstat (limited to 'libindicator')
-rw-r--r--libindicator/indicator-object.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c
index 7188a07..9fc439e 100644
--- a/libindicator/indicator-object.c
+++ b/libindicator/indicator-object.c
@@ -88,6 +88,11 @@ indicator_object_new_from_file (const gchar * file)
return NULL;
}
+ if (!g_file_test(file, G_FILE_TEST_EXISTS)) {
+ g_warning("File '%s' does not exist.", file);
+ return NULL;
+ }
+
GModule * module = g_module_open(file,
G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
if(module != NULL) {