diff options
-rw-r--r-- | qt-models/diveimportedmodel.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-models/diveimportedmodel.cpp b/qt-models/diveimportedmodel.cpp index c1f4f7525..1b8b5a897 100644 --- a/qt-models/diveimportedmodel.cpp +++ b/qt-models/diveimportedmodel.cpp @@ -140,7 +140,10 @@ void DiveImportedModel::setImportedDivesIndexes(int first, int last) void DiveImportedModel::repopulate() { - setImportedDivesIndexes(0, diveTable->nr-1); + if (diveTable->nr) + setImportedDivesIndexes(0, diveTable->nr-1); + else + setImportedDivesIndexes(0, 0); } void DiveImportedModel::recordDives() |