tryZero static method

void tryZero(
  1. List<int>? array
)

Like zero, but silently does nothing if array is null or can't be modified (e.g. an unmodifiable list).

Implementation

static void tryZero(List<int>? array) {
  if (array == null) return;
  try {
    zero(array);
  } catch (_) {}
}