From 7f827bf94441c8bfb6d00ef4e1a423dbd3c7ba8a Mon Sep 17 00:00:00 2001 From: Sebastien Bacher Date: Thu, 10 Feb 2005 22:03:12 +0000 Subject: [PATCH] fix the crash if the given theme is not correct (Closes: #153203). 2005-02-10 Sebastien Bacher * theme-thumbnailer.c: (main): fix the crash if the given theme is not correct (Closes: #153203). --- vfs-methods/themus/ChangeLog | 5 +++++ vfs-methods/themus/theme-thumbnailer.c | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/vfs-methods/themus/ChangeLog b/vfs-methods/themus/ChangeLog index 19cd7b465..194e4ce7d 100644 --- a/vfs-methods/themus/ChangeLog +++ b/vfs-methods/themus/ChangeLog @@ -1,3 +1,8 @@ +2005-02-10 Sebastien Bacher + + * theme-thumbnailer.c: (main): fix the crash if the given theme + is not correct (Closes: #153203). + 2005-02-09 Sebastien Bacher * theme-thumbnailer.c: (main): change back to the previous code, diff --git a/vfs-methods/themus/theme-thumbnailer.c b/vfs-methods/themus/theme-thumbnailer.c index 0b8fbbca6..fba27c133 100644 --- a/vfs-methods/themus/theme-thumbnailer.c +++ b/vfs-methods/themus/theme-thumbnailer.c @@ -141,10 +141,16 @@ main(int argc, char **argv) theme = gnome_theme_read_meta_theme (uri); gnome_vfs_uri_unref (uri); - pixbuf = generate_theme_thumbnail (theme, TRUE); - - save_pixbuf(pixbuf, argv[2]); - gdk_pixbuf_unref(pixbuf); + if (theme) { + pixbuf = generate_theme_thumbnail (theme, TRUE); + + save_pixbuf(pixbuf, argv[2]); + gdk_pixbuf_unref(pixbuf); + } + else { + g_printerr("usage: gnome-theme-thumbnailer theme output-image\n"); + return 1; + } return 0; }