Verified Commit ac74a487 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

types: add safe guard

parent 7fbb1ee8
......@@ -256,6 +256,8 @@ namespace eigenpy
// PyTypeObject * to_py_type = Register::getPyType<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,
to_typenum,
......
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