From 64dbfbd9eb4d681e0d99d11b6858a4450bd8f24c Mon Sep 17 00:00:00 2001 From: rude Date: Sat, 6 Feb 2010 12:40:15 +0100 Subject: [PATCH] Added exception catcher for love.graphics.newFont. --- src/modules/graphics/opengl/wrap_Graphics.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index 407ef4f7d..741e8dd1f 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -207,7 +207,11 @@ namespace opengl { // Check the value. love::filesystem::File * file = luax_checktype(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)) {