Thread: Saved Variables
View Single Post
12-12-15, 01:10 PM   #10
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by SDPhantom View Post
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.
  Reply With Quote