Skip to content

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.
@chrisl8888 chrisl8888 merged commit 3b8447e into hexojs:master Jun 1, 2016
@chrisl8888
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