summaryrefslogtreecommitdiffstats
path: root/src/charts/qchartview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/charts/qchartview.cpp')
-rw-r--r--src/charts/qchartview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/charts/qchartview.cpp b/src/charts/qchartview.cpp
index 6040f7dd..5ce41691 100644
--- a/src/charts/qchartview.cpp
+++ b/src/charts/qchartview.cpp
@@ -144,7 +144,7 @@ void QChartView::mousePressEvent(QMouseEvent *event)
{
#ifndef QT_NO_RUBBERBAND
QGraphicsItem *itemUnderCursor = itemAt(event->pos());
- bool itemUnderCursorAcceptsLMB = (itemUnderCursor->acceptedMouseButtons() & Qt::LeftButton);
+ bool itemUnderCursorAcceptsLMB = itemUnderCursor && (itemUnderCursor->acceptedMouseButtons() & Qt::LeftButton);
bool clickThrough = d_ptr->m_rubberBandFlags.testFlag(ClickThroughRubberBand);
QRectF plotArea = d_ptr->m_chart->plotArea();
if (d_ptr->m_rubberBand && d_ptr->m_rubberBand->isEnabled()