IDE-1340 Added null check