From 58326b150896dd39cdcf2e1c0eba06f1a6fb81cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Capello?= Date: Tue, 26 Nov 2024 09:46:47 -0300 Subject: [PATCH] Handle null target in DragEvent (fix #4824) --- src/ui/drag_event.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/drag_event.h b/src/ui/drag_event.h index ea27cc061..de43ef2bc 100644 --- a/src/ui/drag_event.h +++ b/src/ui/drag_event.h @@ -20,7 +20,8 @@ namespace ui { public: DragEvent(Component* source, ui::Widget* target, os::DragEvent& ev) : Event(source) - , m_position(ev.position() - target->bounds().origin()) + , m_position((target ? ev.position() - target->bounds().origin() + : ev.position())) , m_ev(ev) {} bool handled() const { return m_handled; }