Looking at Actor.sc, I can see a potential issue that matches your error.
(method (observeBlocks)
;; Set the blocks (class Block) which an actor cannot be inside of.
;Make sure there is a set for the blocks.
(if (not blocks)
(= blocks (Set new:))
)
(blocks add: &rest)
)
(method (ignoreBlocks)
;; Delete specified blocks from those which an actor must stay out of.
(blocks delete:&rest)
(if (blocks isEmpty:)
(blocks dispose:)
(= blocks 0)
)
)
Notice this: observeBlocks makes sure there is a blocks, but ignoreBlocks does not. If no other blocks are observed before the toilet block is ignored, (blocks delete:&rest) will fail with a null-pointer exception not-an-object error.
An easy fix would be to always observe the toilet block, and then immediately remove it if the flag tests true:
(gEgo observeBlocks: blockToilet) ;ensures gEgo::blocks is a valid Set
(if (TestFlag gotMembership)
(gEgo ignoreBlocks: blockToilet) ;this should not be able to fail now
)