mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
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>
This commit is contained in:
parent
e5098c443f
commit
ea2e517e39
1 changed files with 2 additions and 1 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Reference in a new issue