Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
O2rki opened this issue May 9, 2024 · 4 comments
Closed

Comments

@O2rki
Copy link

O2rki commented May 9, 2024

Happens when decompile returns a null object, then toASM tries to map.

bitcoinjs-lib/src/script.js

Lines 158 to 162 in 6396fb4

if (chunksIsBuffer(chunks)) {
chunks = decompile(chunks);
}
return chunks
.map(chunk => {

Do I have to check myself (in my code) if decompile returns a null before calling toASM?.

@jasonandjay
Copy link
Collaborator

We can optimize decomplie return value to avoid type error.

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

@O2rki
Copy link
Author

O2rki commented May 10, 2024

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

@jasonandjay
Copy link
Collaborator

OK, we will fix it.

@O2rki
Copy link
Author

O2rki commented May 10, 2024

Thanks @jasonandjay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants