mirror of
https://gitlab.com/smart-pattern/valentina.git
synced 2024-09-19 23:34:04 +02:00
Fix potential issues with ACCESS_VIOLATION_READ.
This commit is contained in:
parent
42ced535cb
commit
f1d0c89f83
|
@ -4668,9 +4668,8 @@ template <typename T> auto VPattern::ToolBoundingRect(const QRectF &rec, quint32
|
|||
QRectF recTool = rec;
|
||||
if (tools.contains(id))
|
||||
{
|
||||
const T *vTool = qobject_cast<T *>(tools.value(id));
|
||||
SCASSERT(vTool != nullptr)
|
||||
|
||||
if (const T *vTool = qobject_cast<T *>(tools.value(id)); vTool != nullptr)
|
||||
{
|
||||
QRectF childrenRect = vTool->childrenBoundingRect();
|
||||
// map to scene coordinate.
|
||||
childrenRect.translate(vTool->scenePos());
|
||||
|
@ -4679,6 +4678,11 @@ template <typename T> auto VPattern::ToolBoundingRect(const QRectF &rec, quint32
|
|||
recTool = recTool.united(childrenRect);
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "qobject_cast failed for tool with id=" << id;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "Can't find tool with id=" << id;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue