Skip to content

Empty tags make Hexo to crash #1704

@PhiLhoSoft

Description

@PhiLhoSoft

Editing the front-matter, I forgot to fill a category, leaving a single dash in the list:

title: Git .gitignore rules
description: Exploration of some points of .gitignore rules
categories:
- Software
- 
tags:
- Software
- Tool
- Command line
- Git
date: 2016-01-08 11:34:00

---

Hexo crashes pretty bad on this file, without leaving a clue about what is the problem...

> hexo gen
ERROR Process failed: _posts/Software/Git gitignore rules.md
TypeError: Cannot read property 'constructor' of null
    at Schema._parseQuery (C:\PhiLhoSoft\Web\PhiLhoSoft.github.io\node_modules\warehouse\lib\schema.js:649:18)
    at Schema._execQuery (C:\PhiLhoSoft\Web\PhiLhoSoft.github.io\node_modules\warehouse\lib\schema.js:669:20)
    at Model.find (C:\PhiLhoSoft\Web\PhiLhoSoft.github.io\node_modules\warehouse\lib\model.js:572:28)
    at Model.findOne (C:\PhiLhoSoft\Web\PhiLhoSoft.github.io\node_modules\warehouse\lib\model.js:612:21)
    at C:\PhiLhoSoft\Web\PhiLhoSoft.github.io\node_modules\hexo\lib\models\post.js:129:27
    at tryCatcher (C:\PhiLhoSoft\Web\PhiLhoSoft.github.io\node_modules\bluebird\js\main\util.js:26:23)
    at ReductionPromiseArray._promiseFulfilled (C:\PhiLhoSoft\Web\PhiLhoSoft.github.io\node_modules\bluebird\js\main\reduce.js:105:38)
    at ReductionPromiseArray.init (C:\PhiLhoSoft\Web\PhiLhoSoft.github.io\node_modules\bluebird\js\main\promise_array.js:92:18)
    at ReductionPromiseArray.init (C:\PhiLhoSoft\Web\PhiLhoSoft.github.io\node_modules\bluebird\js\main\reduce.js:42:10)
    at Async._drainQueue (C:\PhiLhoSoft\Web\PhiLhoSoft.github.io\node_modules\bluebird\js\main\async.js:128:12)
    at Async._drainQueues (C:\PhiLhoSoft\Web\PhiLhoSoft.github.io\node_modules\bluebird\js\main\async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (C:\PhiLhoSoft\Web\PhiLhoSoft.github.io\node_modules\bluebird\js\main\async.js:15:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

If possible, it would be nice to handle this more gracefully, either ignoring the missing entry, or giving an informative error message...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions