File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/browser-utils/src/metrics Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -715,9 +715,13 @@ export function _addResourceSpans(
715
715
716
716
attributes [ 'url.same_origin' ] = resourceUrl . includes ( WINDOW . location . origin ) ;
717
717
718
- const { name, version } = extractNetworkProtocol ( entry . nextHopProtocol ) ;
719
- attributes [ 'network.protocol.name' ] = name ;
720
- attributes [ 'network.protocol.version' ] = version ;
718
+ // Checking for only `undefined` and `null` is intentional because it's
719
+ // valid for `nextHopProtocol` to be an empty string.
720
+ if ( entry . nextHopProtocol != undefined ) {
721
+ const { name, version } = extractNetworkProtocol ( entry . nextHopProtocol ) ;
722
+ attributes [ 'network.protocol.name' ] = name ;
723
+ attributes [ 'network.protocol.version' ] = version ;
724
+ }
721
725
722
726
const startTimestamp = timeOrigin + startTime ;
723
727
const endTimestamp = startTimestamp + duration ;
You can’t perform that action at this time.
0 commit comments