fix: Remove unsafe cast in ContinuousFlyout#2671
Merged
Conversation
BenHenning
approved these changes
Jan 14, 2026
Collaborator
BenHenning
left a comment
There was a problem hiding this comment.
Thanks @gonfunko! This seems a reasonable defensive thing to do, though I wonder if the console log should be a bit more warning/error esque to represent the severity of the fact that the configuration is pretty clearly broken in such a case.
Collaborator
|
Also: I suppose it's possible that the flyout is simply null and not the wrong type, right? The stacktrace, as far as I can tell, is just failing on it being null either due to mismatched type or the value being null (unless I'm misreading it...). |
Contributor
Author
|
Yes, it could just be null, in which case this should still not throw. All it was doing was trying to select the first category, and if there is no toolbox that just becomes a no-op now which seems reasonable. |
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.
The basics
The details
Resolves
Fixes RaspberryPiFoundation/blockly#8884
Proposed Changes
This PR removes an unsafe cast that was assuming the parent toolbox is always non-null. I wasn't able to reproduce the behavior described in #8884, but the stacktrace indicates that the toolbox was null on one of these lines, so handling that case should resolve it.