[Xfce4-commits] <tumbler:master> Don't crash on 0x0 errors (bug #8142).
Nick Schermer
noreply at xfce.org
Fri Dec 2 19:28:01 CET 2011
Updating branch refs/heads/master
to 17bffe45329d974dad4976feb1ee5d475acaad8c (commit)
from ccb09e46f20c1c0b5077a7e93bde457f4ea73a8c (commit)
commit 17bffe45329d974dad4976feb1ee5d475acaad8c
Author: Nick Schermer <nick at xfce.org>
Date: Fri Dec 2 19:25:48 2011 +0100
Don't crash on 0x0 errors (bug #8142).
plugins/pixbuf-thumbnailer/pixbuf-thumbnailer.c | 28 +++++++++++++++++++---
1 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/plugins/pixbuf-thumbnailer/pixbuf-thumbnailer.c b/plugins/pixbuf-thumbnailer/pixbuf-thumbnailer.c
index a1f81cc..a91b03c 100644
--- a/plugins/pixbuf-thumbnailer/pixbuf-thumbnailer.c
+++ b/plugins/pixbuf-thumbnailer/pixbuf-thumbnailer.c
@@ -229,8 +229,18 @@ pixbuf_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer,
if (stream == NULL)
{
- g_signal_emit_by_name (thumbnailer, "error", uri, error->code, error->message);
- g_error_free (error);
+ if (error != NULL)
+ {
+ g_signal_emit_by_name (thumbnailer, "error", uri, error->code,
+ error->message);
+ g_error_free (error);
+ }
+ else
+ {
+ g_signal_emit_by_name (thumbnailer, "error", uri, 0,
+ "Failed to open pixbuf stream");
+ }
+
return;
}
@@ -247,8 +257,18 @@ pixbuf_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer,
if (pixbuf == NULL)
{
- g_signal_emit_by_name (thumbnailer, "error", uri, error->code, error->message);
- g_error_free (error);
+ if (error != NULL)
+ {
+ g_signal_emit_by_name (thumbnailer, "error", uri, error->code,
+ error->message);
+ g_error_free (error);
+ }
+ else
+ {
+ g_signal_emit_by_name (thumbnailer, "error", uri, 0,
+ "Failed to create pixbuf from stream");
+ }
+
g_object_unref (thumbnail);
return;
}
More information about the Xfce4-commits
mailing list