fix #1021

fix #1021

I can not repeat that NPE.