diff options
-rw-r--r-- | qt-ui/profile/diveprofileitem.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 214fd1e12..96947bd02 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -378,6 +378,8 @@ void DiveGasPressureItem::paint(QPainter* painter, const QStyleOptionGraphicsIte pen.setCosmetic(true); pen.setWidth(2); struct dive *d = getDiveById(dataModel->id()); + if (!d) + return; struct plot_data *entry = dataModel->data().entry; Q_FOREACH(const QPolygonF& poly, polygons) { for (int i = 1, count = poly.count(); i < count; i++, entry++) { |