Skip to content

fix: guard GraphicsBlocks arg parent lookups#6180

Open
Rohit-rk07 wants to merge 1 commit intosugarlabs:masterfrom
Rohit-rk07:fix/graphicsblocks-arg-guard-6179
Open

fix: guard GraphicsBlocks arg parent lookups#6180
Rohit-rk07 wants to merge 1 commit intosugarlabs:masterfrom
Rohit-rk07:fix/graphicsblocks-arg-guard-6179

Conversation

@Rohit-rk07
Copy link
Contributor

@Rohit-rk07 Rohit-rk07 commented Mar 9, 2026

Summary

  • guard HeadingBlock.arg, XBlock.arg, and YBlock.arg against missing blockList/parent connections
  • prevent undefined access when tests call arg with a missing blk

Testing

  • npx eslint js/blocks/GraphicsBlocks.js
  • npm test -- js/blocks/tests/GraphicsBlocks.test.js --runInBand

PR Category

  • Bug fix
  • Feature
  • Performance
  • Documentation
  • Tests

Fixes #6179

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

✅ All Jest tests passed! This PR is ready to merge.

@github-actions github-actions bot added the bug fix Fixes a bug or incorrect behavior label Mar 9, 2026
@Rohit-rk07
Copy link
Contributor Author

@omsuneri @walterbender please review as it is very important, tests are failing in all PRs due to this issue. This fix prevents GraphicsBlocks.org methods from crashing when parent connections are missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix Fixes a bug or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regression: GraphicsBlocks arg methods throw when blk is undefined in unit tests

1 participant