love.graphics.getFont errors if there's no graphics context.

Fixes #2176.
This commit is contained in:
Sasha Szpakowski
2025-04-16 21:10:33 -03:00
parent 6a972eec8e
commit 9c5473fc02
+2
View File
@@ -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(); });