Skip to content

Commit

Permalink
BUG: Do not write out empty meta-data fields
Browse files Browse the repository at this point in the history
  • Loading branch information
blowekamp committed Aug 15, 2012
1 parent 64b230b commit f44e632
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Modules/ThirdParty/MetaIO/src/MetaIO/metaUtils.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,13 @@ bool MET_Write(METAIO_STREAM::ostream &fp,
}
case MET_STRING:
{
if ( (*fieldIter)->length == 0 )
{
METAIO_STREAM::cerr << "Warning:";
METAIO_STREAM::cerr << "The field " << (*fieldIter)->name
<< "has zero length. Refusing to write empty string value.";
METAIO_STREAM::cerr << METAIO_STREAM::endl;
}
fp << (*fieldIter)->name << " " << MET_SeperatorChar << " ";
if((*fieldIter)->dependsOn >= 0)
{
Expand Down

0 comments on commit f44e632

Please sign in to comment.