Handle case where debug_file is NULL in debug_msg.