Little fix for generateLevel()

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