diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-11-11 05:54:04 +0900 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-11-11 05:55:20 +0900 |
commit | ea2e517e39e849c7b1e949f87ad263dc13c47714 (patch) | |
tree | dc33ab2dbe67f33c595f19cda7c50b3598949cab /qt-ui/models.cpp | |
parent | e5098c443f55b1b21766538dc32fc56ef7fdb366 (diff) | |
download | subsurface-ea2e517e39e849c7b1e949f87ad263dc13c47714.tar.gz |
Fix crash when cancelling dive add on empty dive list
Don't pass NULL dives around.
Fixes #231
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r-- | qt-ui/models.cpp | 3 |
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]; |