From 3f9613b87fb1375a8e885dd288bae756cd1b12f4 Mon Sep 17 00:00:00 2001 From: Iceman Date: Sat, 10 Aug 2019 18:20:20 +0200 Subject: [PATCH] chg: script run dumptoemul - better fail messages --- client/scripts/dumptoemul.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/scripts/dumptoemul.lua b/client/scripts/dumptoemul.lua index e364ccc8b..96164b92f 100644 --- a/client/scripts/dumptoemul.lua +++ b/client/scripts/dumptoemul.lua @@ -14,7 +14,7 @@ example = [[ script run dumptoemul -i dumpdata-foobar.bin ]] usage = [[ -script run dumptoemul [-i ] [-o ] +_script run dumptoemul [-i ] [-o ] Arguments: -h This help @@ -108,8 +108,11 @@ local function main(args) if infile == nil then return oops('Could not read file ', input) end - local dumpdata = readdump(infile) + + local dumpdata = readdump(infile) -- The hex-data is now in ascii-format, + if dumpdata == NIL then return oops('Dumpfle not loaded') end + -- But first, check the uid local uid = string.sub(dumpdata, 1, 8) @@ -117,6 +120,8 @@ local function main(args) -- Format some linebreaks dumpdata = convert_to_emulform(dumpdata) + if dumpdata == NIL then return oops('Dumpfle not loaded') end + local outfile = io.open(output, 'w') if outfile == nil then