changeset 668:ad7c96620886

* Fix crash when importing CSV file with varying number of columns per row
author Chris Cannam
date Mon, 07 Feb 2011 21:14:09 +0000
parents 1c8898816fd0
children a41b4e30e3d9
files data/fileio/CSVFormat.cpp
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/data/fileio/CSVFormat.cpp	Thu Feb 03 13:15:07 2011 +0000
+++ b/data/fileio/CSVFormat.cpp	Mon Feb 07 21:14:09 2011 +0000
@@ -309,6 +309,9 @@
 CSVFormat::ColumnPurpose
 CSVFormat::getColumnPurpose(int i) const
 {
+    if (m_columnPurposes.size() <= i) {
+        return ColumnUnknown;
+    }
     return m_columnPurposes[i];
 }