fix bug in renameField; Add check for zero length fieldNames in Structure.

This commit is contained in:
Marty Kraimer
2012-06-22 14:04:05 -04:00
parent 3991a51fd6
commit 12d13bc2c0
4 changed files with 37 additions and 9 deletions

View File

@@ -184,6 +184,9 @@ Structure::Structure (StringArray const & fieldNames,FieldConstPtrArray const &
size_t number = fields.size();
for(size_t i=0; i<number; i++) {
String name = fieldNames[i];
if(name.size()<1) {
throw std::invalid_argument("fieldNames has a zero length string");
}
// look for duplicates
for(size_t j=i+1; j<number; j++) {
String otherName = fieldNames[j];