image: Don't segfault when the file doesn't exist
Don't create a window when the file doesn't exist.
https://bugs.freedesktop.org/show_bug.cgi?id=52450
diff --git a/clients/image.c b/clients/image.c
index 711f0d8..c289d76 100644
--- a/clients/image.c
+++ b/clients/image.c
@@ -130,6 +130,12 @@
image->filename = strdup(filename);
image->image = load_cairo_surface(filename);
+
+ if (!image->image) {
+ fprintf(stderr, "could not find the image %s!\n", b);
+ return NULL;
+ }
+
image->window = window_create(display);
image->widget = frame_create(image->window, image);
window_set_title(image->window, title);