getExtension method Null safety

Extension? getExtension(
  1. String messageName,
  2. int tagNumber
)

Retrieves an extension from the registry that adds tag number tagNumber to the messageName message type.

Implementation

Extension? getExtension(String messageName, int tagNumber) {
  var map = _extensions[messageName];
  if (map != null) {
    return map[tagNumber];
  }
  return null;
}