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>
This commit is contained in:
Dirk Hohndel 2017-06-29 14:27:45 -07:00
parent 282698e5d2
commit f4f42a0b97

View file

@ -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++) {