mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix crash on manually added ZXU/DL7 file
The CSV import crashed if the input file had no samples in it. Fixes #566 Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
parent
40cc0b0e4b
commit
f3ab2ee674
1 changed files with 3 additions and 1 deletions
|
@ -737,7 +737,9 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
|
||||||
fileColumns.append(currColumns);
|
fileColumns.append(currColumns);
|
||||||
rows += 1;
|
rows += 1;
|
||||||
}
|
}
|
||||||
resultModel->setColumnValues(fileColumns);
|
|
||||||
|
if (rows > 0)
|
||||||
|
resultModel->setColumnValues(fileColumns);
|
||||||
for (int i = 0; i < headers.count(); i++)
|
for (int i = 0; i < headers.count(); i++)
|
||||||
if (!headers.at(i).isEmpty())
|
if (!headers.at(i).isEmpty())
|
||||||
resultModel->setData(resultModel->index(0, i),headers.at(i),Qt::EditRole);
|
resultModel->setData(resultModel->index(0, i),headers.at(i),Qt::EditRole);
|
||||||
|
|
Loading…
Add table
Reference in a new issue