Changeset 5604


Ignore:
Timestamp:
Apr 13, 2008, 1:36:53 AM (14 years ago)
Author:
charles
Message:

(gtk) possible fix for #866: crash when adding a new torrent.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/add-dialog.c

    r5497 r5604  
    115115destinationChanged( GtkFileChooserButton * b, gpointer gdata )
    116116{
    117     struct AddData * data = gdata;
    118 
    119     g_free( data->destination );
    120     data->destination = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( b ) );
    121 
    122     updateTorrent( data );
    123     verifyRequested( NULL, data );
     117    char * fname = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( b ) );
     118    if( fname )
     119    {
     120        struct AddData * data = gdata;
     121        g_free( data->destination );
     122        data->destination = fname;
     123
     124        updateTorrent( data );
     125        verifyRequested( NULL, data );
     126    }
    124127}
    125128
     
    174177    if( tr_ctorGetDestination( ctor, TR_FORCE, &str ) )
    175178        g_assert_not_reached( );
     179    g_assert( str );
    176180
    177181    data = g_new0( struct AddData, 1 );
Note: See TracChangeset for help on using the changeset viewer.