Add NPE protection