OrThrow<T> extension

Extension on T? to add an orThrow method.

on
  • T?

Methods

orThrow(String message) → T

Available on T?, provided by the OrThrow extension

Returns the value if it is not null, otherwise throws an exception with the provided message.