Changeset 13520


Ignore:
Timestamp:
Sep 23, 2012, 3:38:07 PM (10 years ago)
Author:
jordan
Message:

fix a handful of console warnings that were generated by trying to trash a NULL .torrent file b/c the torrent had been added from a URL

Location:
trunk/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-core.c

    r12973 r13520  
    985985        const char * config = tr_sessionGetConfigDir( session );
    986986        const char * source = tr_ctorGetSourceFile( ctor );
    987         const int is_internal = source && ( strstr( source, config ) == source );
    988 
    989         /* #1294: don't delete the .torrent file if it's our internal copy */
    990         if( !is_internal )
    991             gtr_file_trash_or_remove( source );
     987
     988        if( source != NULL )
     989        {
     990          /* #1294: don't delete the .torrent file if it's our internal copy */
     991          const int is_internal = ( strstr( source, config ) == source );
     992          if( !is_internal )
     993              gtr_file_trash_or_remove( source );
     994        }
    992995    }
    993996
  • trunk/gtk/util.c

    r13388 r13520  
    300300gtr_file_trash_or_remove( const char * filename )
    301301{
     302    GFile * file;
    302303    gboolean trashed = FALSE;
    303     GFile * file = g_file_new_for_path( filename );
     304
     305    g_return_val_if_fail (filename && *filename, 0);
     306
     307    file = g_file_new_for_path( filename );
    304308
    305309    if( gtr_pref_flag_get( PREF_KEY_TRASH_CAN_ENABLED ) ) {
Note: See TracChangeset for help on using the changeset viewer.