Fix NPE from daily use

Fix NPE from daily use, it couldn't reproduce 100%.