Originally Posted by SDPhantom
type() always returns a string no matter what you give it. This means using it directly as a conditional will always return true and using not on it will always return false. The correction on this should be the following.
Code:
if type(dst) ~= "table" then dst = { } end
|
If dst is nil then type(dst) will also return nil.
But of course the ~= "table" checker could be better.