Skip to content

Commit 88485ea

Browse files
committed
Add NULL check
1 parent cb6ad32 commit 88485ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src_c/font.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -664,11 +664,11 @@ font_render(PyObject *self, PyObject *args, PyObject *kwds)
664664
}
665665

666666
SDL_Color foreg = {rgba[0], rgba[1], rgba[2], SDL_ALPHA_OPAQUE};
667-
SDL_Color backg;
667+
SDL_Color backg = {0, 0, 0, SDL_ALPHA_OPAQUE};
668668
int draw_backg = 1;
669669
/* might be overridden right below, with an explicit background color */
670670

671-
if (bg_rgba_obj != NULL && bg_rgba_obj != Py_None) {
671+
if (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)