Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return errors early to avoid long loop read excel file #5731

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Desktop/data/importers/excelimporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "excelimporter.h"
#include "data/importers/excel/excel.h"
#include "data/importers/excel/excelimportcolumn.h"
#include "utilities/qutils.h"
#include <columnutils.h>
#include <string>
#include <QFileInfo>
Expand Down Expand Up @@ -56,6 +57,9 @@ ImportDataSet* ExcelImporter::loadFile(const std::string &locator, std::function
cols = excel.countCols();
importColumns.reserve(cols);

if (cols == 0)
throw std::runtime_error(fq(tr("0 valid columns were read from the file, please check your data file.")));

for (uint32_t row = 0; row < rows; ++row)
{
stringvec lineValues;
Expand Down
Loading