Added pattern matching to convert if to null coalescing action