Permalink
Browse files

changed error handling for clarity

  • Loading branch information...
1 parent ca1373b commit 13bc468898f6a97f9f8b7e2a410107123a034e4d @jsalvatier committed Aug 10, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 numpy/core/src/multiarray/mapping.c
@@ -2038,10 +2038,12 @@ PyArray_MapIterArray(PyArrayObject * a, PyObject * index, int oned, int fancy)
{
PyArrayMapIterObject * mit;
mit = (PyArrayMapIterObject *) PyArray_MapIterNew(index, oned, fancy);
- if (mit != NULL) {
- PyArray_MapIterBind(mit, a);
- PyArray_MapIterReset(mit);
+ if (mit == NULL) {
+ return NULL;
}
+
+ PyArray_MapIterBind(mit, a);
+ PyArray_MapIterReset(mit);
return mit;
}

0 comments on commit 13bc468

Please sign in to comment.