Skip to content

Commit

Permalink
don't fail when body is empty (#1005)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijsnow committed Mar 18, 2022
1 parent 6023d6d commit cd277ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/browser/telemetry.js
Expand Up @@ -403,8 +403,10 @@ Instrumenter.prototype.instrumentNetwork = function() {
// Test to ensure body is a Promise, which it should always be.
if (typeof body.then === 'function') {
body.then(function (text) {
if (self.isJsonContentType(metadata.response_content_type)) {
if (text && self.isJsonContentType(metadata.response_content_type)) {
metadata.response.body = self.scrubJson(text);
} else {
metadata.response.body = text;
}
});
} else {
Expand Down

0 comments on commit cd277ff

Please sign in to comment.