Fix error when using methods/attrs of Cell object

This commit is contained in:
huangbingjian 2022-07-11 10:54:48 +08:00
parent 77667521a6
commit 9670264768
1 changed files with 3 additions and 1 deletions

View File

@ -1384,7 +1384,9 @@ EvalResultPtr GetEvaluatedValueForCellAttrOrMethod(const AnalysisEnginePtr &engi
MS_LOG(EXCEPTION) << "Expect a string, but got: " << item_value->ToString();
}
auto python_obj = func_value->python_obj();
MS_EXCEPTION_IF_NULL(python_obj);
if (python_obj == nullptr) {
return nullptr;
}
auto wrapper_obj = dyn_cast<parse::PyObjectWrapper>(python_obj);
MS_EXCEPTION_IF_NULL(wrapper_obj);
py::object real_python_obj = wrapper_obj->obj();