comparison Main.lua @ 191:5346ba9b6419 1.0.26

Check for nil item string before attempting to get an upgrade ID.
author James D. Callahan III <jcallahan@curse.com>
date Wed, 21 Nov 2012 11:39:08 -0600
parents 35c95e0bce3f
children 85c713407c4f
comparison
equal deleted inserted replaced
190:936e2c9a4633 191:5346ba9b6419
809 local function RecordItemData(item_id, item_link, durability) 809 local function RecordItemData(item_id, item_link, durability)
810 if not durability or durability <= 0 then 810 if not durability or durability <= 0 then
811 return 811 return
812 end 812 end
813 local item = DBEntry("items", item_id) 813 local item = DBEntry("items", item_id)
814 local _, _, _, _, _, _, _, _, _, _, _, upgrade_id = (":"):split(select(3, item_link:find("^|%x+|H(.+)|h%[.+%]"))) 814 local item_string = select(3, item_link:find("^|%x+|H(.+)|h%[.+%]"))
815 815
816 if upgrade_id then 816 if item_string then
817 DBEntry("items", item_id).upgrade_id = upgrade_id 817 local _, _, _, _, _, _, _, _, _, _, _, upgrade_id = (":"):split(item_string)
818
819 if upgrade_id then
820 item.upgrade_id = upgrade_id
821 end
818 end 822 end
819 item.durability = durability 823 item.durability = durability
820 end 824 end
821 825
822 826