fix a NullPointerException look like #950