summaryrefslogtreecommitdiffstats
path: root/Modules/_curses_panel.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_curses_panel.c')
-rw-r--r--Modules/_curses_panel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c
index 08c5f09..b5f30cb 100644
--- a/Modules/_curses_panel.c
+++ b/Modules/_curses_panel.c
@@ -299,6 +299,11 @@ PyCursesPanel_userptr(PyCursesPanelObject *self)
PyObject *obj;
PyCursesInitialised;
obj = (PyObject *) panel_userptr(self->pan);
+ if (obj == NULL) {
+ PyErr_SetString(PyCursesError, "no userptr set");
+ return NULL;
+ }
+
Py_INCREF(obj);
return obj;
}