Skip to content

Commit

Permalink
Document::breakDependency should handle exceptions to avoid to leave …
Browse files Browse the repository at this point in the history
…document in an inconsistent state
  • Loading branch information
wwmayer committed Mar 15, 2019
1 parent 45a0427 commit ca7770b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/App/Document.cpp
Expand Up @@ -3031,7 +3031,13 @@ void Document::breakDependency(DocumentObject* pcObject, bool clear)
std::vector<App::ObjectIdentifier> paths;
pcObject->ExpressionEngine.getPathsToDocumentObject(it->second, paths);
for (std::vector<App::ObjectIdentifier>::iterator jt = paths.begin(); jt != paths.end(); ++jt) {
pcObject->ExpressionEngine.setValue(*jt, nullptr);
// When nullifying the expression handle case where an identifier lacks of the property
try {
pcObject->ExpressionEngine.setValue(*jt, nullptr);
}
catch (const Base::Exception& e) {
e.ReportException();
}
}
}
}
Expand Down

0 comments on commit ca7770b

Please sign in to comment.