Skip to content
Snippets Groups Projects
Commit 4b612f82 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

check for healthy stream after reading

parent 2fa9afda
No related branches found
No related tags found
No related merge requests found
...@@ -1155,6 +1155,10 @@ void OMF::FromStream(std::istream& stream) { ...@@ -1155,6 +1155,10 @@ void OMF::FromStream(std::istream& stream) {
Load(stream, bond_chain_names_); Load(stream, bond_chain_names_);
Load(stream, bond_atoms_); Load(stream, bond_atoms_);
Load(stream, bond_orders_); Load(stream, bond_orders_);
if(!stream.good()) {
throw ost::Error("Cannot read corrupted OMF stream");
}
} }
void OMF::FillChain(ost::mol::ChainHandle& chain, ost::mol::XCSEditor& ed, void OMF::FillChain(ost::mol::ChainHandle& chain, ost::mol::XCSEditor& ed,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment