checkNotNull<T> function

T checkNotNull <T>(T reference, { dynamic message })

Throws an ArgumentError if the given reference is null. Otherwise, returns the reference parameter.

Implementation

T checkNotNull<T>(T reference, {message}) {
  if (reference == null) {
    throw new ArgumentError(_resolveMessage(message, 'null pointer'));
  }
  return reference;
}