bitcoinjs-lib
bitcoinjs-lib copied to clipboard
toASM throws TypeError: Cannot read properties of null (reading 'map')
Happens when decompile
returns a null object, then toASM
tries to map
.
https://github.com/bitcoinjs/bitcoinjs-lib/blob/6396fb488df79dd7cb27eb1b5f9fb56318055ff5/src/script.js#L158-L162
Do I have to check myself (in my code) if decompile
returns a null before calling toASM
?.
We can optimize decomplie return value to avoid type error.
But you should check your logic why get incorrect chunks to exec toASM?
I was debugging the lib. Incorrect chunks may get there for whatever reason.
OK, we will fix it.
Thanks @jasonandjay