[squeak-dev] TheWorldMenu>>newMorphOfClass:event: - a bug and a fix

Eduardo Ochs eduardoochs at gmail.com
Sat Mar 4 13:45:42 UTC 2023


Hi all,

this is my first bug report, and my proposal for how to fix it is
probably too naive... please discuss and rewrite.

Take a menu item - for example, this one,

  World -> new morph... -> from alphabetical list -> L-N -> LineMorph

and put it in the variable itemLineMorph. Then run:

  itemLineMorph debugAction.

On the debugger, click "proceed". You will get an error a few steps
ahead, in this method:

  TheWorldMenu >> #newMorphOfClass:event:

the "evt hand" will fail because evt is nil. One fix is to replace the
"evt hand" in TheWorldMenu>>#newMorphOfClass:event: by:

  (evt ifNotNil: [evt hand] ifNil: [nil currentHand])

Note that that bug is also triggered when we run debugAction from
the halo. See these two messages:

http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-March/223616.html
http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-March/223617.html

  Cheers,
    Eduardo Ochs
    http://anggtwu.net/eev-squeak.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230304/4e7bd84a/attachment.html>


More information about the Squeak-dev mailing list