Browse Source

Check for the presence of `env` before `env.references`.

This commit fixes a "Cannot read property 'references' of undefined"
when parsing "[xxx]". state.env is sometimes undefined, and so are
references as well.
pull/157/head
Bernard Lambeau 10 years ago
parent
commit
68cfe099df
  1. 2
      lib/rules_inline/link.js

2
lib/rules_inline/link.js

@ -95,7 +95,7 @@ module.exports = function link(state, silent) {
//
// Link reference
//
if (typeof state.env.references === 'undefined') { return false; }
if (typeof state.env === 'undefined' || typeof state.env.references === 'undefined') { return false; }
// [foo] [bar]
// ^^ optional whitespace (can include newlines)

Loading…
Cancel
Save