瀏覽代碼

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

Fixes #2176.
Sasha Szpakowski 3 月之前
父節點
當前提交
9c5473fc02
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/modules/graphics/wrap_Graphics.cpp

+ 2 - 0
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(); });