File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -316,20 +316,24 @@ public static void SyncManager(bool setCheckState = false)
316316 // Deletes a file as well as any directories made empty by its deletion
317317 public static void DeleteFileAndDirectories ( string file )
318318 {
319- if ( File . Exists ( file ) ) File . Delete ( file ) ;
319+ try
320+ {
321+ if ( File . Exists ( file ) ) File . Delete ( file ) ;
320322
321- string folder = Path . GetDirectoryName ( file ) ;
323+ string folder = Path . GetDirectoryName ( file ) ;
322324
323- while ( folder != SourcePath )
324- {
325- if ( Directory . Exists ( folder ) && ! Directory . EnumerateFileSystemEntries ( folder ) . Any ( ) )
325+ while ( folder != SourcePath )
326326 {
327- Directory . Delete ( folder , false ) ;
328- }
329- else break ;
327+ if ( Directory . Exists ( folder ) && ! Directory . EnumerateFileSystemEntries ( folder ) . Any ( ) )
328+ {
329+ Directory . Delete ( folder , false ) ;
330+ }
331+ else break ;
330332
331- folder = Directory . GetParent ( folder ) . ToString ( ) ;
333+ folder = Directory . GetParent ( folder ) . ToString ( ) ;
334+ }
332335 }
336+ catch { }
333337 }
334338
335339 // Checks if specified Flashpoint destination path is valid, and optionally updates its respective textbox
You can’t perform that action at this time.
0 commit comments