lua: fix invocation of foreach() with nil type and implicit self
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 5 Nov 2015 17:47:34 +0000 (18:47 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 5 Nov 2015 17:53:09 +0000 (18:53 +0100)
The check for nil on the 2nd argument misses the offset in order to skip over
implicit self which results in
  `bad argument #2 to 'foreach' (string expected, got nil)`
when invoking `uci.cursor():foreach("test", nil, function(s) end)`.

The same call works fine when using dot instead of colon notation.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

No differences found