Jelajahi Sumber

Added exception catcher for love.graphics.newFont.

rude 15 tahun lalu
induk
melakukan
64dbfbd9eb
1 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 5 1
      src/modules/graphics/opengl/wrap_Graphics.cpp

+ 5 - 1
src/modules/graphics/opengl/wrap_Graphics.cpp

@@ -207,7 +207,11 @@ namespace opengl
 		{
 			// Check the value.
 			love::filesystem::File * file = luax_checktype<love::filesystem::File>(L, 1, "File", FILESYSTEM_FILE_T);
-			d = file->read();
+			try {
+				d = file->read();
+			} catch (Exception & e) {
+				return luaL_error(L, e.what());
+			}
 		}
 		else if(luax_istype(L, 1, DATA_T))
 		{