Check type of icon argument in treenode:SetIcon

This commit is contained in:
Kenny Shields 2014-07-01 20:28:07 -04:00
parent 73b8c03b74
commit b35ce451b4

View File

@ -179,7 +179,12 @@ end
function newobject:SetIcon(icon) function newobject:SetIcon(icon)
if type(icon) == "string" then
self.icon = love.graphics.newImage(icon)
else
self.icon = icon self.icon = icon
end
return self return self
end end