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(
219
219
long totalSize = 0 )
220
220
{
221
221
string ? sourceDir = string . Empty ;
222
-
222
+
223
223
if ( source is not null && source . Any ( ) )
224
224
sourceDir = PathNormalization . GetParentDir ( source . First ( ) . Path ) ;
225
225
@@ -498,9 +498,15 @@ public static void UpdateCardStrings(StatusCenterItem card)
498
498
499
499
if ( card . Source is not null && card . Source . Any ( ) )
500
500
{
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
+ }
504
510
}
505
511
506
512
if ( card . Destination is not null && card . Destination . Any ( ) )
You can’t perform that action at this time.
0 commit comments