diff --git a/show_fs.lua b/show_fs.lua index 3075712..b986b5a 100644 --- a/show_fs.lua +++ b/show_fs.lua @@ -35,6 +35,13 @@ end -- show formspec with highest possible version information for the player -- force_version: optional parameter yl_speak_up.show_fs_ver = function(pname, formname, formspec, force_version) + -- catch errors + if(not(formspec)) then + force_version = "1" + formspec = "size[4,2]label[0,0;Error: No text found for form\n\"".. + minetest.formspec_escape(formname).."\"]".. + "button_exit[1.5,1.5;1,0.5;exit;Exit]" + end -- if the formspec already calls for a specific formspec version: use that one if(string.sub(formspec, 1, 17) == "formspec_version[") then minetest.show_formspec(pname, formname, formspec)