Fix possible NullPointerException.

Signed-off-by: yushijinhun <yushijinhun@gmail.com>