Module:ItemData: Difference between revisions

Jump to navigation Jump to search
m nil check for component json
m fixed null components
Line 79: Line 79:
local components = item['Components']
local components = item['Components']
--return empty string if no component found
--return empty string if no component found
if(item == nil) then return "" end
if(components == nil) then return nil end
local component = get_json_item(components[1])
local component = get_json_item(components[1])
if (component == nil) then return "" end
if (component == nil) then return nil end
return component['Name']
return component['Name']