aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html-display.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-format-html-display.c')
-rw-r--r--mail/em-format-html-display.c8
1 files changed, 7 insertions, 1 deletions
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);