Fixes a crash when saving attachments fails
authorSergio Villar Senín <svillar@igalia.com>
Thu, 21 Jan 2010 15:50:18 +0000 (16:50 +0100)
committerSergio Villar Senín <svillar@igalia.com>
Thu, 21 Jan 2010 15:50:18 +0000 (16:50 +0100)
Fixes NB#153599

src/hildon2/modest-msg-view-window.c

index 9749443..0c48c82 100644 (file)
@@ -3220,7 +3220,7 @@ save_mime_part_to_file (SaveMimePartInfo *info)
                if (written < 0) {
                        g_warning ("modest: could not save attachment %s: %d (%s)\n", pair->filename, error?error->code:-1, error?error->message:"Unknown error");
 
-                       if ((error->domain == TNY_ERROR_DOMAIN) && 
+                       if (error && (error->domain == TNY_ERROR_DOMAIN) &&
                            (error->code == TNY_IO_ERROR_WRITE) &&
                            (errno == ENOSPC)) {
                                info->result = GNOME_VFS_ERROR_NO_SPACE;