detecting single nil argument in lua
snippet in lua

detecting single nil argument in lua

user3465

function myFunc(...)
  if select('#', ...) == 0 then
    print "Called without argument"
  elseif select('#', ...) == 1 and select(1, ...) == nil then
    print "Called with a nil argument"
  end
end