Description
When scrolling the mouse wheel on the canvas, the Service Worker
throws an uncaught TypeError in the console repeatedly, making
debugging difficult.
Error
Uncaught (in promise) TypeError: Cannot read properties of null
(reading 'children')
at Activity.setSmallerLargerStatus (activity.js:2188:43)
at Activity._doSmallerBlocks (activity.js:2176:24)
at doSmallerBlocks (activity.js:2145:28)
at HTMLCanvasElement.__wheelHandler (activity.js:2525:55)
Steps to Reproduce
- Open https://musicblocks.sugarlabs.org/
- Open DevTools → Console tab (F12)
- Scroll mouse wheel on the canvas area
- Observe repeated TypeErrors in console
Expected Behavior
Mouse wheel scrolling should resize blocks smoothly with no
console errors.
Actual Behavior
setSmallerLargerStatus attempts to read .children on a null
element without a null check, causing repeated uncaught
TypeErrors on every scroll event.
Suggested Fix
Add a null guard in activity.js around line 2188:
// Before
someElement.children
// After
if (someElement) {
someElement.children
}
Environment
Checklist
Description
When scrolling the mouse wheel on the canvas, the Service Worker
throws an uncaught TypeError in the console repeatedly, making
debugging difficult.
Error
Steps to Reproduce
Expected Behavior
Mouse wheel scrolling should resize blocks smoothly with no
console errors.
Actual Behavior
setSmallerLargerStatusattempts to read.childrenon a nullelement without a null check, causing repeated uncaught
TypeErrors on every scroll event.
Suggested Fix
Add a null guard in
activity.jsaround line 2188:Environment
Checklist