Skip to content

Commit

Permalink
Add extra check for undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
kale-io authored Nov 13, 2017
1 parent 84bd995 commit 1a42593
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/gatsby-react-router-scroll/src/StateStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ export default class SessionStorage {
getStateKey(location, key) {
const locationKey = location.key
const stateKeyBase = `${STATE_KEY_PREFIX}${locationKey}`
return key === null ? stateKeyBase : `${stateKeyBase}|${key}`
return (key === null || typeof key === `undefined`) ? stateKeyBase : `${stateKeyBase}|${key}`
}
}

0 comments on commit 1a42593

Please sign in to comment.