mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
RulerItem2::settingsChanged() - NULL pointer dereference
The current code is dereferencing the null pointer 'profWidget'. It can cause a segmentation fault. Signed-off-by: Marcos Cardinot <mcardinot@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d500f56d6f
commit
70b4c9f2d3
1 changed files with 5 additions and 1 deletions
|
@ -83,7 +83,11 @@ void RulerItem2::settingsChanged()
|
||||||
ProfileWidget2 *profWidget = NULL;
|
ProfileWidget2 *profWidget = NULL;
|
||||||
if (scene() && scene()->views().count())
|
if (scene() && scene()->views().count())
|
||||||
profWidget = qobject_cast<ProfileWidget2 *>(scene()->views().first());
|
profWidget = qobject_cast<ProfileWidget2 *>(scene()->views().first());
|
||||||
setVisible(profWidget->currentState == ProfileWidget2::PROFILE ? prefs.rulergraph : false);
|
|
||||||
|
if (profWidget && profWidget->currentState == ProfileWidget2::PROFILE)
|
||||||
|
setVisible(prefs.rulergraph);
|
||||||
|
else
|
||||||
|
setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RulerItem2::recalculate()
|
void RulerItem2::recalculate()
|
||||||
|
|
Loading…
Add table
Reference in a new issue