Handle null contents gracefully in message passing API (#657)

In messages "Read Resource Response" and "Read Module Response", if `contents` and `error` are both null, default to an empty byte array/string.

This resolves one of the issues reported in #656
This commit is contained in:
Josh B
2024-10-01 12:54:06 -07:00
committed by GitHub
parent cc1e432a30
commit b072794d0d
4 changed files with 86 additions and 2 deletions

View File

@@ -414,6 +414,8 @@ The response to <<read-resource-request>>.
If successful, `contents` is set.
Otherwise, `error` is set.
If neither is set, `contents` defaults to an empty byte array.
[source,pkl]
----
/// A number identifying this request.
@@ -463,6 +465,8 @@ The response to <<read-module-request>>.
If successful, `contents` is set.
Otherwise, `error` is set.
If neither is set, `contents` defaults to an empty string.
[source,pkl]
----
/// A number identifying this request.