RefactoringEssentials icon indicating copy to clipboard operation
RefactoringEssentials copied to clipboard

Merge sequential checks, replacing them with a null conditional operator

Open corliss opened this issue 8 years ago • 0 comments
trafficstars

ReSharper supports this very useful refactoring:

if (a != null && a.b != null)
{
}

to

if (a ?.b != null)
{
}

In Resharper this works with arbitrarily long sequential checks, e.g. if (a?.b?.c?.d != null)

This is sorely missed in RefactoringEssentials. Be great to have it. Cheers.

corliss avatar Jan 05 '17 21:01 corliss