Skip to content

Commit 832fc4e

Browse files
committed
Add NULL check
1 parent 31954f7 commit 832fc4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src_c/font.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ font_render(PyObject *self, PyObject *args, PyObject *kwds)
668668
int draw_backg = 1;
669669
/* might be overridden right below, with an explicit background color */
670670

671-
if (bg_rgba_obj != Py_None) {
671+
if (bg_rgba_obj != NULL && bg_rgba_obj != Py_None) {
672672
if (!pg_RGBAFromObjEx(bg_rgba_obj, rgba, PG_COLOR_HANDLE_ALL)) {
673673
return 0; // exception already set.
674674
}

0 commit comments

Comments
 (0)