File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
src/Files.App/Utils/StatusCenter Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ public static StatusCenterItem AddCard_Delete(
219219 long totalSize = 0 )
220220 {
221221 string ? sourceDir = string . Empty ;
222-
222+
223223 if ( source is not null && source . Any ( ) )
224224 sourceDir = PathNormalization . GetParentDir ( source . First ( ) . Path ) ;
225225
@@ -498,9 +498,15 @@ public static void UpdateCardStrings(StatusCenterItem card)
498498
499499 if ( card . Source is not null && card . Source . Any ( ) )
500500 {
501- sourcePath = PathNormalization . GetParentDir ( card . Source . First ( ) ) ;
502- sourceDirName = sourcePath . Split ( '\\ ' ) . Last ( ) ;
503- sourceFileName = card . Source . First ( ) . Split ( '\\ ' ) . Last ( ) ;
501+ // Include null check for items that don't have a parent dir
502+ // This can happen when dragging an image from the browser
503+ // https://github.com/files-community/Files/issues/13590
504+ if ( card . Source . First ( ) != null )
505+ {
506+ sourcePath = PathNormalization . GetParentDir ( card . Source . First ( ) ) ;
507+ sourceDirName = sourcePath . Split ( '\\ ' ) . Last ( ) ;
508+ sourceFileName = card . Source . First ( ) . Split ( '\\ ' ) . Last ( ) ;
509+ }
504510 }
505511
506512 if ( card . Destination is not null && card . Destination . Any ( ) )
You can’t perform that action at this time.
0 commit comments