From 8aecd161b7dfd5fafa24702610bc3c930928ec22 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Thu, 23 Aug 2001 21:09:03 +0000 Subject: [Fix #5736, crashing when copying a message with drag and drop.] * e-storage-set-view.c (tree_drag_data_received): Handle NULL data gracefully. svn path=/trunk/; revision=12422 --- shell/e-storage-set-view.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'shell/e-storage-set-view.c') diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c index a49e00f3bb..8ea0b59318 100644 --- a/shell/e-storage-set-view.c +++ b/shell/e-storage-set-view.c @@ -1275,8 +1275,16 @@ tree_drag_data_received (ETree *etree, corba_data.target = selection_data->target; corba_data.bytes._release = FALSE; - corba_data.bytes._length = selection_data->length; - corba_data.bytes._buffer = selection_data->data; + + if (selection_data->data == NULL) { + /* If data is NULL the length is -1 and this would mess things + up so we handle it separately. */ + corba_data.bytes._length = 0; + corba_data.bytes._buffer = NULL; + } else { + corba_data.bytes._length = selection_data->length; + corba_data.bytes._buffer = selection_data->data; + } /* pass off the data to the component's DestinationFolderInterface */ handled = GNOME_Evolution_ShellComponentDnd_DestinationFolder_handleDrop (destination_folder_interface, -- cgit