Do not access transform tool handles if NULL or stales

For example starting GIMP and pressing

Ctrl-N Enter Shift-T (or Shift-R or Shift-P)

showed warnings on the console, and with window manager's
focus mode set to 'click' it was also possible to crash GIMP.
This commit is contained in:
Massimo Valentini 2011-09-13 18:03:30 +02:00
parent 83e3e58ebc
commit 27feccc4a4
1 changed files with 1 additions and 1 deletions

View File

@ -473,7 +473,7 @@ gimp_transform_tool_oper_update (GimpTool *tool,
GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
TransformAction function = TRANSFORM_HANDLE_NONE;
if (display != tool->display)
if (display != tool->display || draw_tool->item == NULL)
{
gimp_transform_tool_set_function (tr_tool, function);
return;