bitcoinjs-lib icon indicating copy to clipboard operation
bitcoinjs-lib copied to clipboard

toASM throws TypeError: Cannot read properties of null (reading 'map')

Open O2rki opened this issue 9 months ago • 4 comments

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?.

O2rki avatar May 09 '24 10:05 O2rki

We can optimize decomplie return value to avoid type error.

But you should check your logic why get incorrect chunks to exec toASM?

jasonandjay avatar May 10 '24 02:05 jasonandjay

I was debugging the lib. Incorrect chunks may get there for whatever reason.

O2rki avatar May 10 '24 10:05 O2rki

OK, we will fix it.

jasonandjay avatar May 10 '24 11:05 jasonandjay

Thanks @jasonandjay

O2rki avatar May 10 '24 11:05 O2rki