summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/longobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index afe30bc..ae3a98c 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -5403,7 +5403,7 @@ int_from_bytes_impl(PyTypeObject *type, PyObject *bytes_obj,
little_endian, is_signed);
Py_DECREF(bytes);
- if (type != &PyLong_Type) {
+ if (long_obj != NULL && type != &PyLong_Type) {
Py_SETREF(long_obj, PyObject_CallFunctionObjArgs((PyObject *)type,
long_obj, NULL));
}