diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-06-29 14:27:45 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-06-29 15:10:42 -0700 |
commit | f4f42a0b97182681d92c991482fa2064251f7ac7 (patch) | |
tree | dc11083370a7c903fee44309c1f5a4ac02768756 /qt-models/diveimportedmodel.cpp | |
parent | 282698e5d25241e1c38fe7f455ca9f38b35ef590 (diff) | |
download | subsurface-f4f42a0b97182681d92c991482fa2064251f7ac7.tar.gz |
Don't crash trying to record zero dives
If the user clicks "Accept" when no dives were downloaded we would otherwise
dereference unitialized memory.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/diveimportedmodel.cpp')
-rw-r--r-- | qt-models/diveimportedmodel.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/qt-models/diveimportedmodel.cpp b/qt-models/diveimportedmodel.cpp index 799dd6ce6..66be4b5cf 100644 --- a/qt-models/diveimportedmodel.cpp +++ b/qt-models/diveimportedmodel.cpp @@ -163,6 +163,10 @@ void DiveImportedModel::repopulate() void DiveImportedModel::recordDives() { + if (diveTable->nr == 0) + // nothing to do, just exit + return; + // walk the table of imported dives and record the ones that the user picked // clearing out the table as we go for (int i = 0; i < rowCount(); i++) { |