Fix npe
Properly fix NPE