Getting variable type?

Is there a function (s) that would check a variable type, and at the same time not error. Help is appreciated.

local vtype = type(variable) or nil?

[lua]local vtype = var && type(var) || “none”[/lua]

Gee, thanks.

type returns “nil” when called with a nil argument, there is no need to do any of this.

[editline]8th January 2011[/editline]

When does type error?

[editline]8th January 2011[/editline]

When I say with a nil argument, that doesn’t include not passing any arguments, which you just wouldn’t do.

I just didn’t know the proper function to check a variable type. Searched “type” on wiki, but it gave me random shit. Wasn’t that clever to look into globals anyway.