Fix crash with --debug=file and NULL file return