Skip to content

Commit 2dfce79

Browse files
AnastassiaPMrJul
authored andcommitted
Fix null reference crash when window is closed during drag-and-drop (#18760)
1 parent 21fe205 commit 2dfce79

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

native/Avalonia.Native/src/OSX/AvnView.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,8 @@ - (NSDragOperation)triggerAvnDragEvent: (AvnDragEventType) type info: (id <NSDra
836836

837837
auto effects = ConvertDragDropEffects(nsop);
838838
auto parent = _parent.tryGet();
839+
if (!parent)
840+
return NSDragOperationNone;
839841
int reffects = (int)parent->TopLevelEvents
840842
->DragEvent(type, point, modifiers, effects,
841843
CreateClipboard([info draggingPasteboard], nil),

0 commit comments

Comments
 (0)