Skip to content

Commit

Permalink
πŸ› add null test
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Aug 20, 2019
1 parent 230a4e2 commit e4cb014
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/get-string-if-constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}
Expand Down

0 comments on commit e4cb014

Please sign in to comment.