diff --git a/src/libs/vtools/dialogs/tools/dialogtool.cpp b/src/libs/vtools/dialogs/tools/dialogtool.cpp index 809635e4d..af36c41af 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtool.cpp @@ -928,8 +928,16 @@ void DialogTool::Build(const Tool &type) //--------------------------------------------------------------------------------------------------------------------- void DialogTool::SetAssociatedTool(VAbstractTool *tool) { - this->associatedTool=tool; - SetToolId(tool->getId()); + if (tool != nullptr) + { + associatedTool = tool; + SetToolId(tool->getId()); + } + else + { + associatedTool = nullptr; + SetToolId(NULL_ID); + } } //---------------------------------------------------------------------------------------------------------------------