From 411a537800a3e80ac987d1d7e6037c9a87a62bf7 Mon Sep 17 00:00:00 2001 From: Ignacio Hernandez Date: Sat, 8 Feb 2020 18:36:18 -0800 Subject: [PATCH] Validate pointer before dereferencing it InkScale::on_motion_notify_event crashes when cursor cannot be created. Signed-off-by: Ignacio Hernandez --- src/ui/widget/ink-spinscale.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/widget/ink-spinscale.cpp b/src/ui/widget/ink-spinscale.cpp index 6fd79c9afa..12928ea607 100644 --- a/src/ui/widget/ink-spinscale.cpp +++ b/src/ui/widget/ink-spinscale.cpp @@ -147,7 +147,8 @@ InkScale::on_motion_notify_event(GdkEventMotion* motion_event) { // Can't see how to do this the C++ way since GdkEventMotion // is a structure with a C window member. There is a gdkmm // wrapping function for Gdk::EventMotion but only in unstable. - gdk_window_set_cursor( motion_event->window, cursor->gobj() ); + if (cursor) + gdk_window_set_cursor( motion_event->window, cursor->gobj() ); } return false; -- GitLab