diff --git a/lib/src/client/http2_connection.dart b/lib/src/client/http2_connection.dart index d0a50b4b..ce87d6ab 100644 --- a/lib/src/client/http2_connection.dart +++ b/lib/src/client/http2_connection.dart @@ -161,8 +161,9 @@ class Http2ClientConnection implements connection.ClientConnection { metadata, compressionCodec, userAgent: options.userAgent, - grpcAcceptEncodings: callOptions?.metadata['grpc-accept-encoding'] ?? - options.codecRegistry?.supportedEncodings, + grpcAcceptEncodings: + (callOptions?.metadata ?? const {})['grpc-accept-encoding'] ?? + options.codecRegistry?.supportedEncodings, ); final stream = _transportConnection.makeRequest(headers); return Http2TransportStream(