Skip to content
Snippets Groups Projects
Verified Commit ac74a487 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

types: add safe guard

parent 7fbb1ee8
No related branches found
No related tags found
No related merge requests found
...@@ -256,6 +256,8 @@ namespace eigenpy ...@@ -256,6 +256,8 @@ namespace eigenpy
// PyTypeObject * to_py_type = Register::getPyType<To>(); // PyTypeObject * to_py_type = Register::getPyType<To>();
int to_typenum = Register::getTypeCode<To>(); int to_typenum = Register::getTypeCode<To>();
assert(to_typenum >= 0 && "to_typenum is not valid");
assert(from_array_descr != NULL && "to_typenum is not valid");
if(PyArray_RegisterCastFunc(from_array_descr, if(PyArray_RegisterCastFunc(from_array_descr,
to_typenum, to_typenum,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment