fix: Add check for existing array before reading#2042
Open
marsv024 wants to merge 1 commit intoprotobufjs:masterfrom
Open
fix: Add check for existing array before reading#2042marsv024 wants to merge 1 commit intoprotobufjs:masterfrom
marsv024 wants to merge 1 commit intoprotobufjs:masterfrom
Conversation
When parsing a proto and handling oneofs there is no check if the array actually exists before reading it, causing the code to throw errors some times. This change add a check if the oneoffsArray exist before trying to read it.
Contributor
|
@sofisl Is this something you could help get merged and released? I found this open PR after we started running into this error as well, but I'm not sure who exactly to ping. It seems to be much more likely to hit the I added a minimal repro of the issue to #1958. I'm happy to add a regression test as well if it will help this get merged and released. Thanks! |
Contributor
|
@dcodeIO Is this something you could help get merged and released? Or who would be the best maintainer to take a look? Thanks! |
|
would be nice to have this merged. we use an npm hook in order to manually fix package after installation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When parsing a proto and handling oneofs there is no check if the array actually exists before reading it, causing the code to throw errors some times.
This change add a check if the oneoffsArray exist before trying to read it.
Seems to be the samme issue as described in: #1958