diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index f9408526..73cdce0e 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -234,6 +234,8 @@ template struct npy_format_descriptor } static const char* format() { + if (!dtype_()) + pybind11_fail("NumPy: unsupported buffer format!"); return format_(); }