Skip to content

Commit 49a9153

Browse files
committed
GrpcWebClientReadableStream: keep falsy data
1 parent 35284bf commit 49a9153

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

javascript/net/grpc/web/grpcwebclientreadablestream.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,18 @@ class GrpcWebClientReadableStream {
170170
if (FrameType.DATA in messages[i]) {
171171
const data = messages[i][FrameType.DATA];
172172
if (data) {
173+
let isResponseDeserialized = false;
173174
let response;
174175
try {
175176
response = self.responseDeserializeFn_(data);
177+
isResponseDeserialized = true;
176178
} catch (err) {
177179
self.handleError_(new RpcError(
178180
StatusCode.INTERNAL,
179181
`Error when deserializing response data; error: ${err}` +
180182
`, response: ${response}`));
181183
}
182-
if (response) {
184+
if (isResponseDeserialized) {
183185
self.sendDataCallbacks_(response);
184186
}
185187
}

0 commit comments

Comments
 (0)