Skip to content

Fix: Fixed crash when dropping items onto a folder from another windo… - #18805

Open
TRUINGLol wants to merge 1 commit into
files-community:mainfrom
TRUINGLol:tr/FixCrossWindowDropCrash
Open

Fix: Fixed crash when dropping items onto a folder from another windo…#18805
TRUINGLol wants to merge 1 commit into
files-community:mainfrom
TRUINGLol:tr/FixCrossWindowDropCrash

Conversation

@TRUINGLol

Copy link
Copy Markdown

Resolved / Related Issues

What was wrong

BaseLayoutPage.Item_Drop read e.Data, which is only populated for drags started within the same XAML island. A drag coming from another window travels through the shell, so e.Data is null there and the getter threw a NullReferenceException. Since Item_Drop is an async void handler, the exception went unhandled on the UI thread and took the whole window down.

Steps used to test these changes

  1. Opened Files and opened a second window (two windows, not two tabs).
  2. Dragged a file from the first window onto a folder icon in the second window — the file is moved/copied and both windows stay alive. Before this change the second window crashed, losing all its tabs.
  3. Verified no regressions on the other item-level drop targets: drop onto a folder within a single window, drop from File Explorer, drop onto an executable and a script (Open with), drop onto a folder shortcut, drop into a zip folder, drop onto a folder in the Grid layout with scroll-locking during drag, and drop onto empty space.

@yair100 yair100 added the ready for review Pull requests that are ready for review label Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Pull requests that are ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Window Crashes when doing Drag and Drop

2 participants