-
Notifications
You must be signed in to change notification settings - Fork 26k
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
fix(core): do not crash for signal query that does not have any matches #54353
Conversation
The newly introduced signal queries would error if no match exists, due to an invalid read within the query internals. This commit addresses the crash by allowing there to be no matches.
for (let i = 0; i < tQueryMatches.length; i += 2) { | ||
const tQueryMatches = tQuery.matches; | ||
const result: Array<T|null> = []; | ||
for (let i = 0; tQueryMatches !== null && i < tQueryMatches.length; i += 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: how about an early exit after checking for tQueryMatches !== null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty array is assigned to lQuery.matches
, so adjusting the control flow would get a bit awkward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thnx @JoostK !
Left one nit commit, feel free to ignore.
caretaker note: I don't think G3 failure is related |
This PR was merged into the repository by commit abf6371. |
…es (angular#54353) The newly introduced signal queries would error if no match exists, due to an invalid read within the query internals. This commit addresses the crash by allowing there to be no matches. PR Close angular#54353
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The newly introduced signal queries would error if no match exists, due to an invalid read within the query internals.
This commit addresses the crash by allowing there to be no matches.