[fix] fixed potentially NPE bug