tools: Don't disconnect rasterized layer signals

In the path tool, when setting a new vector layer as
the editable path, we try to disconnect the old signal for
gimp_path_tool_vector_layer_path_changed () from the
vector layer options. However, if this code is triggered
because we rasterized the vector layer while the path
tool was active, it will throw a warning because the
layer options are NULL. This patch adds a check to make
sure the options exist before trying to disconnect their
"notify::path" signal.
This commit is contained in:
Alx Sa 2026-02-20 02:48:05 +00:00
parent 4bfa65d72d
commit 2af5aa651a

View file

@ -991,9 +991,11 @@ gimp_path_tool_set_layer (GimpPathTool *path_tool,
if (path_tool->current_vector_layer)
{
layer_options = gimp_vector_layer_get_options (path_tool->current_vector_layer);
g_signal_handlers_disconnect_by_func (layer_options,
gimp_path_tool_vector_layer_path_changed,
path_tool);
if (layer_options)
g_signal_handlers_disconnect_by_func (layer_options,
gimp_path_tool_vector_layer_path_changed,
path_tool);
g_signal_handlers_disconnect_by_func (options,
gimp_path_tool_vector_change_notify,