Navigation Menu

Skip to content

Commit

Permalink
Spreadsheet: getProperty does not return 0 when property is not found…
Browse files Browse the repository at this point in the history
…, but throws an exception. Handle this instead.
  • Loading branch information
eivindkv authored and wwmayer committed Feb 17, 2015
1 parent 4ab13b9 commit c3af423
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Mod/Spreadsheet/App/PropertySheet.cpp
Expand Up @@ -90,14 +90,16 @@ class BuildDocDepsExpressionVisitor : public ExpressionVisitor {
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
}
}
}

Expand Down

0 comments on commit c3af423

Please sign in to comment.