From 01259d8e889148e83b3ab324134e8402765edeab Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Wed, 2 Apr 2008 09:24:30 +0000 Subject: [PATCH 1/1] * src/maemo/modest-msg-edit-window.c: * On attaching files and images, check if we could create the stream properly, or show a proper banner else (fixes NB#83215). pmo-trunk-r4361 --- src/maemo/modest-msg-edit-window.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/maemo/modest-msg-edit-window.c b/src/maemo/modest-msg-edit-window.c index a9fd316..f31916b 100644 --- a/src/maemo/modest-msg-edit-window.c +++ b/src/maemo/modest-msg-edit-window.c @@ -2241,6 +2241,16 @@ modest_msg_edit_window_insert_image (ModestMsgEditWindow *window) (modest_runtime_get_platform_factory ()); TnyStream *stream = create_stream_for_uri (uri); + + if (stream == NULL) { + + modest_platform_information_banner (NULL, NULL, dgettext("hildon-fm", "sfil_ib_opening_not_allowed")); + + g_object_unref (mime_part); + gnome_vfs_file_info_unref (info); + continue; + } + tny_mime_part_construct (mime_part, stream, mime_type, "base64"); content_id = g_strdup_printf ("%d", priv->next_cid); @@ -2350,8 +2360,16 @@ modest_msg_edit_window_attach_file_one ( (modest_runtime_get_platform_factory ()); stream = create_stream_for_uri (uri); - tny_mime_part_construct (mime_part, stream, mime_type, "base64"); + if (stream == NULL) { + + modest_platform_information_banner (NULL, NULL, dgettext("hildon-fm", "sfil_ib_opening_not_allowed")); + g_object_unref (mime_part); + gnome_vfs_file_info_unref (info); + return; + } + + tny_mime_part_construct (mime_part, stream, mime_type, "base64"); g_object_unref (stream); content_id = g_strdup_printf ("%d", priv->next_cid); -- 1.7.9.5