Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds some nil checks #272

Merged
merged 1 commit into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion samples/repl.app/repl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ limitations under the License.

return function (stdin, stdout, uv, utils, greeting)

local loadstring = loadstring or load

local print = function(...)
uv.write(stdout, table.concat({...}, "\t") .. "\n")
end
Expand Down Expand Up @@ -67,7 +69,7 @@ return function (stdin, stdout, uv, utils, greeting)
end
else

if err:match "'<eof>'$" then
if err and err:match "'<eof>'$" then
-- Lua expects some more input; stow it away for next time
buffer = chunk .. '\n'
return '>>'
Expand Down
1 change: 1 addition & 0 deletions samples/repl.app/utils.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
local uv = require('uv')
local env = require('env')

local unpack = unpack or table.unpack
local prettyPrint, dump, strip, color, colorize, loadColors
local theme = {}
local useColors = false
Expand Down
2 changes: 1 addition & 1 deletion src/lua/luvibundle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ local function zipBundle(base, zip)

-- Support zips with a single folder inserted at top-level
local entries = bundle.readdir("")
if #entries == 1 and bundle.stat(entries[1]).type == "directory" then
if entries and #entries == 1 and bundle.stat(entries[1]).type == "directory" then
chrootBundle(bundle, entries[1] .. '/')
end

Expand Down