summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/profilegraphics.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index 9973af101..30adef132 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -217,7 +217,7 @@ QColor ProfileGraphicsView::getColor(const color_indice_t i)
void ProfileGraphicsView::plot(struct dive *d, bool forceRedraw)
{
- struct divecomputer *dc;
+ struct divecomputer *dc = NULL;
if (d)
dc = select_dc(&d->dc);
@@ -247,7 +247,7 @@ void ProfileGraphicsView::plot(struct dive *d, bool forceRedraw)
// Fix this for printing / screen later.
// plot_set_scale(scale_mode_t);
- if (!dc->samples) {
+ if (!dc || !dc->samples) {
dc = fake_dc(dc);
}