Revert "fix npe"

This reverts commit ce6ef8cb2e94c80f6e6f4490bcec8d5d777ff48d.