Spreadsheet: getProperty does not return 0 when property is not found, but throws an exception. Handle this instead.

This commit is contained in:
Eivind Kvedalen 2015-02-16 00:41:30 +01:00 committed by wmayer
parent 4ab13b9fea
commit c3af4232a4

View File

@ -90,14 +90,16 @@ public:
VariableExpression *expr = freecad_dynamic_cast<VariableExpression>(node);
if (expr) {
const App::Property * prop = expr->getProperty();
if (prop) {
try {
const App::Property * prop = expr->getProperty();
App::DocumentObject * docObj = freecad_dynamic_cast<DocumentObject>(prop->getContainer());
if (docObj)
docDeps.insert(docObj);
}
catch (const Base::Exception &) {
// Ignore this type of exception; it means that the property was not found, which is ok here
}
}
}