Skip to content
Permalink
Browse files

πŸ› add null test

  • Loading branch information...
mysticatea committed Aug 20, 2019
1 parent 230a4e2 commit e4cb01498df6096b66edb0c78965ee6f47d3ac77
Showing with 1 addition and 1 deletion.
  1. +1 βˆ’1 src/get-string-if-constant.js
@@ -8,7 +8,7 @@ import { getStaticValue } from "./get-static-value"
*/
export function getStringIfConstant(node, initialScope = null) {
// Handle the literals that the platform doesn't support natively.
if (node.type === "Literal" && node.value === null) {
if (node && node.type === "Literal" && node.value === null) {
if (node.regex) {
return `/${node.regex.pattern}/${node.regex.flags}`
}

0 comments on commit e4cb014

Please sign in to comment.
You can’t perform that action at this time.