Skip to content

Commit

Permalink
don't crash on 'empty' documents. should fix #37
Browse files Browse the repository at this point in the history
  • Loading branch information
Ko van der Sloot authored and Ko van der Sloot committed Nov 13, 2019
1 parent b584e5d commit 2369946
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/FoLiA-2text.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,18 @@ int main( int argc, char *argv[] ){
}
}
else {
ofstream os( outname );
UnicodeString us = d->text( class_name,retaintok);
os << us << endl;
UnicodeString us;
try {
UnicodeString us = d->text( class_name, retaintok);
}
catch( ... ){
cout << "document '" << docName << "' contains no text in class="
<< class_name << endl;
}
if ( !us.isEmpty() ){
ofstream os( outname );
os << us << endl;
}
#pragma omp critical
{
cout << "Processed :" << docName << " into " << outname
Expand Down

0 comments on commit 2369946

Please sign in to comment.