diff --git a/include/pybind11/detail/class.h b/include/pybind11/detail/class.h index 6c88986f..b1916fcd 100644 --- a/include/pybind11/detail/class.h +++ b/include/pybind11/detail/class.h @@ -469,7 +469,7 @@ extern "C" inline int pybind11_getbuffer(PyObject *obj, Py_buffer *view, int fla if (tinfo && tinfo->get_buffer) break; } - if (view == nullptr || obj == nullptr || !tinfo || !tinfo->get_buffer) { + if (view == nullptr || !tinfo || !tinfo->get_buffer) { if (view) view->obj = nullptr; PyErr_SetString(PyExc_BufferError, "pybind11_getbuffer(): Internal error");