diff --git a/ChangeLog.txt b/ChangeLog.txt index 018eff5f0..71e34807a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,6 @@ +# Valentina 0.7.49 (unreleased) +- Fix crash. + # Valentina 0.7.48 June 29, 2021 - [smart-pattern/valentina#129] Incorrect behavior of empty arc and elliptical arc. - Parsing formulas with not canonical math symbols. diff --git a/src/libs/vwidgets/vgraphicssimpletextitem.cpp b/src/libs/vwidgets/vgraphicssimpletextitem.cpp index 3c3167b0a..2f83e85b2 100644 --- a/src/libs/vwidgets/vgraphicssimpletextitem.cpp +++ b/src/libs/vwidgets/vgraphicssimpletextitem.cpp @@ -125,14 +125,17 @@ void VGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphic void VGraphicsSimpleTextItem::setEnabled(bool enabled) { QGraphicsSimpleTextItem::setEnabled(enabled); - const QPalette palet = this->scene()->palette(); - if (enabled) + if (this->scene()) { - setBrush(palet.brush(QPalette::Active, QPalette::Text)); - } - else - { - setBrush(palet.brush(QPalette::Disabled, QPalette::Text)); + const QPalette palet = this->scene()->palette(); + if (enabled) + { + setBrush(palet.brush(QPalette::Active, QPalette::Text)); + } + else + { + setBrush(palet.brush(QPalette::Disabled, QPalette::Text)); + } } }