fixed nullptr crash