Skip to content

Commit

Permalink
fix stdoutStream access in ledger/key
Browse files Browse the repository at this point in the history
  • Loading branch information
cryi committed Sep 5, 2024
1 parent 5717211 commit becdc1c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/__xtz/deposits_limit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ local _proc = proc.spawn("bin/client", _args, {
})

log_info("Please confirm adjusting of deposit limits...")
local _stderr = _proc.stderrStream:read("a")
ami_assert(_proc.exitcode == 0, "Failed to set/unset deposits limit: " .. (_stderr or ""))
local _stderr = _proc.stderrStream:read("a") or ""
ami_assert(_proc.exitcode == 0, "Failed to set/unset deposits limit: " .. _stderr)

log_success("Deposits limit adjusted.")
4 changes: 2 additions & 2 deletions src/__xtz/ledger/authorize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ local function setup(options)
env = { HOME = path.combine(os.cwd(), "data") }
})

local _stderr = _proc.stderrStream:read("a")
local _stderr = _proc.stderrStream:read("a") or ""
ami_assert(_proc.exitcode == 0 or not _stderr:match("Error:"),
"Failed to setup ledger for baking: " .. (_stderr or ""))
"Failed to setup ledger for baking: " .. _stderr)

log_success("Ledger authorized for baking.")
end
Expand Down
2 changes: 1 addition & 1 deletion src/__xtz/ledger/key.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ local function setup(options)
})

ami_assert(_proc.exitcode == 0, "Failed to get connected ledgers: " .. (_proc.stderrStream:read("a") or "unknown"))
local _output = _proc.stdoutStream:read("a")
local _output = _proc.stdoutStream:read("a") or ""
ledgerId = _output:match("## Ledger `(.-)`")
ami_assert(ledgerId, "No connected ledgers found!", EXIT_APP_INTERNAL_ERROR)
log_info("Using ledger id: " .. ledgerId)
Expand Down
2 changes: 1 addition & 1 deletion src/specs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "xtz.signer",
"version" : "0.23.8+20.2",
"version" : "0.23.9+20.2",
"dependencies": [
{ "id":"xtz.base" }
]
Expand Down

0 comments on commit becdc1c

Please sign in to comment.