Fix crash when create an internal path.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-01-13 16:06:03 +02:00
parent 548f7844f4
commit c065824306

View File

@ -229,11 +229,14 @@ void DialogPiecePath::ShowVisualization()
{ {
AddVisualization<VisToolPiecePath>(); AddVisualization<VisToolPiecePath>();
VToolSeamAllowance *tool = qobject_cast<VToolSeamAllowance*>(VAbstractPattern::getTool(GetPieceId())); if (m_showMode)
SCASSERT(tool != nullptr); {
auto visPath = qobject_cast<VisToolPiecePath *>(vis); VToolSeamAllowance *tool = qobject_cast<VToolSeamAllowance*>(VAbstractPattern::getTool(GetPieceId()));
SCASSERT(visPath != nullptr); SCASSERT(tool != nullptr);
visPath->setParentItem(tool); auto visPath = qobject_cast<VisToolPiecePath *>(vis);
SCASSERT(visPath != nullptr);
visPath->setParentItem(tool);
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------