From dacc17e1b706f46f93fd484ef15d60b5a70c0e93 Mon Sep 17 00:00:00 2001 From: bjorn Date: Wed, 24 Jan 2024 17:54:07 -0800 Subject: [PATCH] Fix errhand loop when debug library is unavailable; --- etc/boot.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/boot.lua b/etc/boot.lua index 72ff56e4..ead585fe 100644 --- a/etc/boot.lua +++ b/etc/boot.lua @@ -194,7 +194,7 @@ local function formatTraceback(s) end function lovr.errhand(message) - message = 'Error:\n\n' .. tostring(message) .. formatTraceback(debug.traceback('', 4)) + message = 'Error:\n\n' .. tostring(message) .. formatTraceback(debug and debug.traceback('', 4) or '') print(message) @@ -289,7 +289,7 @@ lovr.handlers = setmetatable({}, { __index = lovr }) return coroutine.create(function() local function onerror(...) onerror = function(...) - print('Error:\n\n' .. tostring(...) .. formatTraceback(debug.traceback('', 1))) + print('Error:\n\n' .. tostring(...) .. formatTraceback(debug and debug.traceback('', 1) or '')) return function() return 1 end end