assertNotNull function

bool assertNotNull(
  1. Object? value,
  2. String context
)

Assert a value is not null.

Implementation

bool assertNotNull(Object? value, String context) {
  if (value == null) {
    stderr.writeln('    assertNotNull failed: $context — got null');
    return false;
  }
  return true;
}