diff --git a/scripts/gui/gm-editor.lua b/scripts/gui/gm-editor.lua index 2afca8f23..9526d396d 100644 --- a/scripts/gui/gm-editor.lua +++ b/scripts/gui/gm-editor.lua @@ -174,6 +174,7 @@ function GmEditorUi:getSelectedEnumType() local trg=self:currentTarget() local trg_key=trg.keys[self.subviews.list_main:getSelected()] if trg.target._field==nil then return nil end + if trg.target:_field(trg_key)==nil then return nil end local enum=trg.target:_field(trg_key)._type if enum._kind=="enum-type" then return enum