From 9c5473fc02e61b1de0472a73ca9ae2ebcc22e4bc Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Wed, 16 Apr 2025 21:10:33 -0300 Subject: [PATCH] love.graphics.getFont errors if there's no graphics context. Fixes #2176. --- src/modules/graphics/wrap_Graphics.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/graphics/wrap_Graphics.cpp b/src/modules/graphics/wrap_Graphics.cpp index d20d50488..670203124 100644 --- a/src/modules/graphics/wrap_Graphics.cpp +++ b/src/modules/graphics/wrap_Graphics.cpp @@ -2555,6 +2555,8 @@ int w_setFont(lua_State *L) int w_getFont(lua_State *L) { + luax_checkgraphicscreated(L); + Font *f = nullptr; luax_catchexcept(L, [&](){ f = instance()->getFont(); });