From c3af4232a40f28b35698b765de3e20745bec59ce Mon Sep 17 00:00:00 2001 From: Eivind Kvedalen Date: Mon, 16 Feb 2015 00:41:30 +0100 Subject: [PATCH] Spreadsheet: getProperty does not return 0 when property is not found, but throws an exception. Handle this instead. --- src/Mod/Spreadsheet/App/PropertySheet.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Mod/Spreadsheet/App/PropertySheet.cpp b/src/Mod/Spreadsheet/App/PropertySheet.cpp index 5891cff4cd73..0b95dd49a9dd 100644 --- a/src/Mod/Spreadsheet/App/PropertySheet.cpp +++ b/src/Mod/Spreadsheet/App/PropertySheet.cpp @@ -90,14 +90,16 @@ class BuildDocDepsExpressionVisitor : public ExpressionVisitor { VariableExpression *expr = freecad_dynamic_cast(node); if (expr) { - const App::Property * prop = expr->getProperty(); - - if (prop) { + try { + const App::Property * prop = expr->getProperty(); App::DocumentObject * docObj = freecad_dynamic_cast(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 + } } }