getProfileByIndex method

DebugProfile getProfileByIndex(
  1. int index
)

Safely get profile by index (throws if invalid)

Implementation

DebugProfile getProfileByIndex(int index) {
  if (index < 0 || index >= _profiles.length) {
    throw ArgumentError.value(index, 'index', 'Invalid profile index');
  }
  return _profiles[index];
}