aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/em-format-html-display.c8
2 files changed, 14 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index ff0e89fff5..f882497878 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2008-09-09 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #493298
+
+ * em-format-html-display.c: (efhd_image): Do not try to access widget
+ of the pury when the operation has been cancelled.
+
2008-09-08 Milan Crha <mcrha@redhat.com>
** Fix for bug #328216
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index 3985b96ec7..5bb9cc32d3 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -61,6 +61,7 @@
#include <camel/camel-cipher-context.h>
#include <camel/camel-folder.h>
#include <camel/camel-string-utils.h>
+#include <camel/camel-operation.h>
#include <misc/e-cursors.h>
#include <e-util/e-util.h>
@@ -1249,7 +1250,12 @@ efhd_image(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormat
info->handle = handle;
info->shown = TRUE;
info->snoop_mime_type = ((EMFormat *) efh)->snoop_mime_type;
- info->fit_width = ((GtkWidget *)((EMFormatHTML *)info->puri.format)->html)->allocation.width - 12;
+ if (camel_operation_cancel_check (NULL) || !info->puri.format || !((EMFormatHTML *)info->puri.format)->html) {
+ /* some fake value, we are cancelled anyway, thus doesn't matter */
+ info->fit_width = 256;
+ } else {
+ info->fit_width = ((GtkWidget *)((EMFormatHTML *)info->puri.format)->html)->allocation.width - 12;
+ }
camel_stream_printf(stream, "<td><object classid=\"%s\"></object></td>", classid);
g_free(classid);