Little fix for generateLevel()

Check if $generator is the default value null instead of false