GetVariable(string name)
Returns the value of the given variable. If the variable is not found, returns nil.
But, if var1 doesn't exist, type(SKIN:GetVariable('var1')) will fail and return a error message in Log:Script: xxx.lua:X: bad argument #1 to 'type' (value expected)