IDE-1338 Added null checks