fix null error when generating to -o .