From b35ce451b44e8d3d8f2c57552e01f529eb11a355 Mon Sep 17 00:00:00 2001 From: Kenny Shields Date: Tue, 1 Jul 2014 20:28:07 -0400 Subject: [PATCH] Check type of icon argument in treenode:SetIcon --- objects/internal/treenode.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/objects/internal/treenode.lua b/objects/internal/treenode.lua index 0de276b..4d79e45 100644 --- a/objects/internal/treenode.lua +++ b/objects/internal/treenode.lua @@ -179,7 +179,12 @@ end function newobject:SetIcon(icon) - self.icon = icon + if type(icon) == "string" then + self.icon = love.graphics.newImage(icon) + else + self.icon = icon + end + return self end