diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 1ae12396a1..d3b48ae675 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -2043,7 +2043,10 @@ PLyList_FromArray(PLyDatumToOb *arg, Datum d) elm->typlen, elm->typbyval, elm->typalign, &isnull); if (isnull) + { + Py_INCREF(Py_None); PyList_SET_ITEM(list, i, Py_None); + } else PyList_SET_ITEM(list, i, elm->func(elm, elem)); }