Protect access to EffectFrame if not used

Caused a crash when Show Text was disabled.
This commit is contained in:
Martin Gräßlin 2012-10-26 09:36:51 +02:00
parent a6ab97172e
commit c3f2b68581

View file

@ -196,7 +196,10 @@ void MouseClickEffect::repaint()
int ymax = 0;
int yfontMax = 0;
foreach (MouseEvent* click, m_clicks) {
QRect fontGeo = click->m_frame->geometry();
QRect fontGeo;
if (click->m_frame) {
fontGeo = click->m_frame->geometry();
}
xmin = qMin<int>(xmin, click->m_pos.x());
ymin = qMin<int>(ymin, click->m_pos.y());
xmax = qMax<int>(xmax, click->m_pos.x() + (fontGeo.width() + 10));