Added null check to custom condition