From deede02ed890ce09709e13f81a5903ab144ebead Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Tue, 27 Aug 2019 18:24:15 +0800 Subject: [PATCH] App: more sanity check in ObjectIdentifier --- src/App/ObjectIdentifier.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/App/ObjectIdentifier.cpp b/src/App/ObjectIdentifier.cpp index 2109e21324..37c09ec337 100644 --- a/src/App/ObjectIdentifier.cpp +++ b/src/App/ObjectIdentifier.cpp @@ -620,6 +620,8 @@ Py::Object ObjectIdentifier::Component::get(const Py::Object &pyobj) const { Base::PyException::ThrowException(); res = Py::asObject(r); } + if(!res.ptr()) + Base::PyException::ThrowException(); if(PyModule_Check(res.ptr()) && !ExpressionParser::isModuleImported(res.ptr())) FC_THROWM(Base::RuntimeError, "Module '" << getName() << "' access denied."); return res;