summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 0324fe4ba..22e422273 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -320,7 +320,8 @@ void CylindersModel::setDive(dive* d)
{
if (current)
clear();
-
+ if (!d)
+ return;
int amount = MAX_CYLINDERS;
for(int i = 0; i < MAX_CYLINDERS; i++) {
cylinder_t *cylinder = &d->cylinder[i];