Migration: extract a common method for doing null checks.
Migration: extract a common method for doing null checks.

Change-Id: I7864d93a7208357075583263c471f4faf20231ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113270
Reviewed-by: Mike Fairhurst <2002604e76601be549134505841fea93de80dc45@google.com>
Reviewed-by: Konstantin Shcheglov <09e4d7516628963212bf4aace2f97603d2b706e4@google.com>
Commit-Queue: Paul Berry <72d414e3a99fb120308437779d51667bcc0984eb@google.com>

dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk