Skip to content

Commit b5265c6

Browse files
anonrigaduh95
andauthored
Update lib/internal/url.js
Co-authored-by: Antoine du Hamel <[email protected]>
1 parent b0f5fed commit b5265c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/url.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ class URL {
961961
const out = URL.parse(path);
962962
// Only return origin of scheme is `http` or `https`
963963
// Otherwise return a new opaque origin (null).
964-
if (out && (out.#context.scheme_type === 0 || out.#context.scheme_type === 2)) {
964+
if (out?.#context.scheme_type === 0 || out?.#context.scheme_type === 2) {
965965
return `${out.protocol}//${out.host}`;
966966
}
967967
}

0 commit comments

Comments
 (0)