Fix crash caused by bf57c78fd0f0463d0630fbc1a323179b228b5591