Skip to content
Snippets Groups Projects
Commit 69d4d53d authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Kirill Yukhin
Browse files

box/console: Test for nil value in args directly

Instead of allocating a variable for optional args
testing we should use dot notation instead. Otherwise
it won't work for trivial test case as

```
require('console').set_default_output('lua,block')
require('decimal').new('1234.5678')
```

 | builtin/box/console.lua:47: expected decimal, number or string as 2 argument

and program exits.

Part-of #3834
parent df71cbdc
No related branches found
No related tags found
No related merge requests found
......@@ -41,10 +41,9 @@ output_handlers["yaml"] = function(status, opts, ...)
end
output_handlers["lua"] = function(status, opts, ...)
local data = ...
--
-- Don't print nil if there is no data
if data == nil then
if not ... then
return ""
end
--
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment