diff data/fileio/CSVFormat.cpp @ 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 3a5ee4b6c9ad
children 611a4fa14dde
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];
 }