Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1855: Addresses "TypeError: Cannot read property 'compile' of undefined" #1910

Merged
merged 1 commit into from
Jun 1, 2016

Conversation

w0rd-driven
Copy link
Contributor

This checks to make sure an object is returned from render.getRenderer(ext);.

The following snippet changes https://github.com/hexojs/hexo/blob/master/lib/theme/processors/view.js#L18 to be something like https://github.com/hexojs/hexo/blob/master/lib/theme/processors/source.js#L28-L35, but there may be cases it doesn't properly account for.

exports.pattern = new Pattern(function(path) {
  if (!_.startsWith(path, 'layout/')) return false;

  path = path.substring(7);
  var regex = /(^|\/)[\.]/;
  if (regex.test(path) || common.isTmpFile(path) || ~path.indexOf('node_modules')) return false;

  return {path: path};
});

…ndefined" very specifically, by checking that renderer properly exists first.
@chrisjlee chrisjlee merged commit 3b8447e into hexojs:master Jun 1, 2016
@chrisjlee
Copy link
Collaborator

Seems simple enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants