summaryrefslogtreecommitdiff
path: root/numpy/core/src/arrayobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r--numpy/core/src/arrayobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index 084eaaf7a..55254b5e9 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -3502,7 +3502,8 @@ _check_axis(PyArrayObject *arr, int *axis, int flags)
if ((*axis >= MAX_DIMS) || (n==0)) {
temp = PyArray_Ravel(arr,0);
- *axis = PyArray_NDIM(temp)-1;
+ if (temp) *axis = PyArray_NDIM(temp)-1;
+ else *axis = 0;
return temp;
}
else {