CLDIDE-2162 Added checking of NPE