Fix null point access.

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