Haha, yep, that's a clever feature! The game is simply supposed to end at this point. Which, on a web game, corresponds to crashing, because web browsers don't allow interacting outside the scope of the game.
But if you saw it as a bug, it is probably a case of bad game design. When I designed it, I did not expect the web version to just freeze instead of closing, and the only way to avoid this behavior was implementing a game over screen, which I did not have the time to do.