Description
getParsedPath calls path.parse(Url.parse(url).pathname) without a null fallback. For malformed/edge URL inputs where pathname is null, path.parse throws a TypeError, which can crash callers like getRemoteFileExtension/getRemoteFileName. The TypeScript equivalent in gatsby-core-utils already guards this with || '', indicating this JS version is less safe.
Severity: medium
File: packages/gatsby-source-filesystem/src/utils.js
Expected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.
Description
getParsedPathcallspath.parse(Url.parse(url).pathname)without a null fallback. For malformed/edge URL inputs wherepathnameisnull,path.parsethrows aTypeError, which can crash callers likegetRemoteFileExtension/getRemoteFileName. The TypeScript equivalent ingatsby-core-utilsalready guards this with|| '', indicating this JS version is less safe.Severity:
mediumFile:
packages/gatsby-source-filesystem/src/utils.jsExpected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.