Description
Using add 1 to with the pitch number block before the turtle has played a note fails.
MyPitchBlock.setter() assumes tur.singer.lastNotePlayed exists, but it is null before the first note. The setter then tries to read lastNotePlayed[1].
Expected Behavior
The pitch number should initialize and increment successfully even when no note has been played yet.
Screenshots
Not applicable.
How to Reproduce
A source-level reproduction is currently confirmed:
- Set
tur.singer.lastNotePlayed to null.
- Invoke
MyPitchBlock.setter().
The setter accesses tur.singer.lastNotePlayed[1] and throws.
Console log Errors
TypeError: Cannot read properties of null (reading '1')
at MyPitchBlock.setter
Environment
- Browser: Google Chrome 151
- Node.js: v22.22.3
- Version of Software/Project: current
master (b48c67a)
Checklist
Description
Using
add 1 towith thepitch numberblock before the turtle has played a note fails.MyPitchBlock.setter()assumestur.singer.lastNotePlayedexists, but it isnullbefore the first note. The setter then tries to readlastNotePlayed[1].Expected Behavior
The pitch number should initialize and increment successfully even when no note has been played yet.
Screenshots
Not applicable.
How to Reproduce
A source-level reproduction is currently confirmed:
tur.singer.lastNotePlayedtonull.MyPitchBlock.setter().The setter accesses
tur.singer.lastNotePlayed[1]and throws.Console log Errors
Environment
master(b48c67a)Checklist