Bugfix/#628 bring to front exception

Fix for https://github.com/spritebuilder/SpriteBuilder/issues/628.