From 49258cac8c846bccdb863351d25fc7feffb3a41d Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 2 Jul 2016 12:12:12 +0300 Subject: [PATCH] Added additional checks to method DialogTool::SetAssociatedTool. --HG-- branch : develop --- src/libs/vtools/dialogs/tools/dialogtool.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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); + } } //---------------------------------------------------------------------------------------------------------------------