Skip to content

Commit 674084a

Browse files
Update src/a2a/server/request_handlers/grpc_handler.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 73bd270 commit 674084a

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/a2a/server/request_handlers/grpc_handler.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ def _get_metadata_value(
5454
context: grpc.aio.ServicerContext, key: str
5555
) -> list[str]:
5656
md = context.invocation_metadata()
57-
raw_values: list[str | bytes] = []
58-
if isinstance(md, Metadata):
59-
raw_values = md.get_all(key)
57+
raw_values: list[str | bytes] = md.get_all(key) if isinstance(md, Metadata) else []
6058

6159
return [e if isinstance(e, str) else e.decode('utf-8') for e in raw_values]
6260

0 commit comments

Comments
 (0)