Skip to content

Commit

Permalink
[server] Fix potential crash when attempting to normalize module path (
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Nov 30, 2019
1 parent 03e77e9 commit a7fb020
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/@sanity/server/src/browser/process-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ module.exports = function processUpdate(hash, moduleMap, callbacks = {}) {
}

function normalizeModulePath(pathName) {
if (!pathName) {
return {path: '<unknown>'}
}

const [path, partName] = pathName.split('?sanityPart=')
return {path, partName: partName && decodeURIComponent(partName)}
}
Expand Down

0 comments on commit a7fb020

Please sign in to comment.