Skip to content

Commit

Permalink
fix(raw_vehicle_cmd_converter): return false if table is empty (autow…
Browse files Browse the repository at this point in the history
…arefoundation#5463)

Signed-off-by: M. Fatih Cırıt <[email protected]>
  • Loading branch information
xmfcx authored Nov 2, 2023
1 parent 4e00bf2 commit 70e3c79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vehicle/raw_vehicle_cmd_converter/src/csv_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ bool CSVLoader::validateMap(const Map & map, const bool is_col_decent)

bool CSVLoader::validateData(const Table & table, const std::string & csv_path)
{
if (table.empty()) {
std::cerr << "The table is empty." << std::endl;
return false;
}
if (table[0].size() < 2) {
std::cerr << "Cannot read " << csv_path.c_str() << " CSV file should have at least 2 column"
<< std::endl;
Expand Down

0 comments on commit 70e3c79

Please sign in to comment.