Skip to content

Commit

Permalink
fix #274886
Browse files Browse the repository at this point in the history
In some cases e is nullptr. I change if statement to avoid utilizing nullptr pointer
  • Loading branch information
handrok committed Aug 2, 2018
1 parent 10ebbb9 commit dd47602
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions libmscore/fermata.cpp
Expand Up @@ -194,10 +194,12 @@ void Fermata::layout()

qreal x = 0.0;
Element* e = s->element(track());
if (e && e->isChord())
x = score()->noteHeadWidth() * staff()->mag(0) * .5;
else
x = e->x() + e->width() * staff()->mag(0) * .5;
if (e) {
if (e->isChord())
x = score()->noteHeadWidth() * staff()->mag(0) * .5;
else
x = e->x() + e->width() * staff()->mag(0) * .5;
}
qreal y = placeAbove() ? styleP(Sid::fermataPosAbove) : styleP(Sid::fermataPosBelow) + staff()->height();

setPos(QPointF(x, y));
Expand Down

0 comments on commit dd47602

Please sign in to comment.