From 3af118dce985a97668b41e4108431b6dc42e22db Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 21 Sep 2023 01:18:56 -0400 Subject: [PATCH] Check that SDL_ShowSimpleMessageBox has been bound first This function can be called before DFSDL is initialized --- library/modules/DFSDL.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/modules/DFSDL.cpp b/library/modules/DFSDL.cpp index 4d8bb3be5..dec43a1c5 100644 --- a/library/modules/DFSDL.cpp +++ b/library/modules/DFSDL.cpp @@ -162,6 +162,8 @@ SDL_Surface* DFSDL::DFSDL_CreateRGBSurfaceWithFormat(uint32_t flags, int width, } int DFSDL::DFSDL_ShowSimpleMessageBox(uint32_t flags, const char *title, const char *message, SDL_Window *window) { + if (!g_SDL_ShowSimpleMessageBox) + return -1; return g_SDL_ShowSimpleMessageBox(flags, title, message, window); }