Commit d2e652f6 authored by Tomasz Socha's avatar Tomasz Socha Committed by Scott Cyphers

[PY] Add check if pointer in capsule contains a nullptr (#3798)

parent bc968cd0
......@@ -58,7 +58,7 @@ void regclass_pyngraph_Function(py::module m)
auto* capsule_ptr = PyCapsule_GetPointer(pybind_capsule_ptr, CAPSULE_NAME);
auto* ngraph_function = static_cast<std::shared_ptr<ngraph::Function>*>(capsule_ptr);
if (ngraph_function)
if (ngraph_function && *ngraph_function)
{
return *ngraph_function;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment