app: expect event == NULL in gimp_device_info_get_event_coords().

The problem was not happening with the master code of
gimpdisplayshell-tool-events.c, but I encountered it in gimp-2-10 with
the layer picking code.
Even then, it still works, but I need to protect calls to
gdk_event_get_axis() to avoid CRITICALs.

(cherry picked from commit b1fe1675ce)

Note: this was not absolutely necessary on master (no CRITICALs), but I
can see that the same piece of code applies, so I may as well sync.
This commit is contained in:
Jehan 2019-01-08 14:19:11 +01:00
parent fc55e7bd7f
commit b31729f821
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ gimp_device_info_get_event_coords (GimpDeviceInfo *info,
{
gdouble x;
if (gdk_event_get_axis (event, GDK_AXIS_X, &x))
if (event && gdk_event_get_axis (event, GDK_AXIS_X, &x))
{
*coords = default_coords;