View Issue Details

IDProjectCategoryView StatusLast Update
0002631Spring engineLuapublic2016-02-15 01:33
ReporterJools Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version0.82.7.1 
Summary0002631: LuaUI/widgets.lua crashes on local widget error
DescriptionAn error in function widget:GetConfigData(data) causes the whole LUAUI to crash. Infolog produces the following error:

Lua LoadCode pcall error = 2, luaui.lua, error = 2, LuaUI/widgets.lua, [string "LuaUI\Widgets\tp_SEH.lua"]:18: attempt to index global 'undefinedvar' (a nil value)
Additional InformationA test widget to reproduce the error is attached here.

local versionNumber = "1.0"

function widget:GetInfo()
    return {
        name = "Spring exception hunter",
        desc = "Test a bug in spring lua",
        author = "Jools",
        date = "Sep 1, 2011",
        license = "GNU GPL v2",
        layer = 0,
        enabled = true
    }
end

local var1

function widget:GetConfigData(data) -- save
    if undefinedvar.stupidcode then -- CRASH ON THIS LINE
        --Echo("Saving config data")
        return {
            var1 = var1
        }
    end
end

function widget:SetConfigData(data) -- load
    var1 = data.var1
end
TagsNo tags attached.
Attached Files
infolog.txt (Attachment missing)
tp_SEH.lua (Attachment missing)
Checked infolog.txt for Errors

Activities

jK

2011-09-05 21:35

developer   ~0007327

infolog does not indicate a crash of whole luaui.

Jools

2011-09-06 17:43

reporter   ~0007335

Well, maybe there are some parts of it that don't crash then, but to the user it's the same thing. If you put this widget in your widgets folder then there is *nothing* you can do in-game to make game working.

The game will appear with just a commander, buildmenu and resources bar. All other lua-things crash, for instance there is no minimap and no way to press F11 to enable widgets. So typing /luaui reload doesn't work, and that's why I thought the whole luaui crashed. Because it is effectively not working. Just try for yourself.

A similar error in one of my widgets forced people to reinstall the whole widgets folder to make the game working.

Anonymous

2016-02-15 01:33

viewer   ~0015786

Fix 5778cde5e2d53880b398bd442efb6786b82e8bbe committed to develop branch: fix 0002631, repo: spring changeset id: 6621

Issue History

Date Modified Username Field Change
2011-09-01 17:22 Jools New Issue
2011-09-01 17:22 Jools File Added: infolog.txt
2011-09-05 21:35 jK Note Added: 0007327
2011-09-06 17:35 Jools File Added: tp_SEH.lua
2011-09-06 17:43 Jools Note Added: 0007335
2016-02-15 01:33 Changeset attached => spring develop 5778cde5
2016-02-15 01:33 Anonymous Note Added: 0015786
2016-02-15 01:33 Anonymous Status new => resolved
2016-02-15 01:33 Anonymous Resolution open => fixed