From becdc1c1722a70801211382c044ede21f894b598 Mon Sep 17 00:00:00 2001 From: v Date: Thu, 5 Sep 2024 05:24:36 +0200 Subject: [PATCH] fix stdoutStream access in ledger/key --- src/__xtz/deposits_limit.lua | 4 ++-- src/__xtz/ledger/authorize.lua | 4 ++-- src/__xtz/ledger/key.lua | 2 +- src/specs.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/__xtz/deposits_limit.lua b/src/__xtz/deposits_limit.lua index aad7fff..991eaa2 100644 --- a/src/__xtz/deposits_limit.lua +++ b/src/__xtz/deposits_limit.lua @@ -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.") \ No newline at end of file diff --git a/src/__xtz/ledger/authorize.lua b/src/__xtz/ledger/authorize.lua index 51d2b77..eb450f1 100644 --- a/src/__xtz/ledger/authorize.lua +++ b/src/__xtz/ledger/authorize.lua @@ -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 diff --git a/src/__xtz/ledger/key.lua b/src/__xtz/ledger/key.lua index ff449cb..282f047 100644 --- a/src/__xtz/ledger/key.lua +++ b/src/__xtz/ledger/key.lua @@ -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) diff --git a/src/specs.json b/src/specs.json index 422d926..3d25dd7 100755 --- a/src/specs.json +++ b/src/specs.json @@ -1,6 +1,6 @@ { "id": "xtz.signer", - "version" : "0.23.8+20.2", + "version" : "0.23.9+20.2", "dependencies": [ { "id":"xtz.base" } ]