Skip to content

Sorting topic crashes Node #13

@mariusursache

Description

@mariusursache

Tried sorting the 'random' topic with three triggers (*, hello*, are you *?), and got this error:

/Users/Me/projects/superscript-editor/node_modules/superscript/lib/topics/sort.js:19
    var match  = trig.input.match(/\{weight=(\d+)\}/i);
                     ^
TypeError: Cannot read property 'input' of null
    at Object.exports.sortTriggerSet (/Users/Me/projects/superscript-editor/node_modules/superscript/lib/topics/sort.js:19:22)
    at /Users/Me/projects/superscript-editor/node_modules/superscript/lib/topics/topic.js:70:26
    at /Users/Me/projects/superscript-editor/node_modules/superscript/node_modules/async/lib/async.js:240:13
    at done (/Users/Me/projects/superscript-editor/node_modules/superscript/node_modules/async/lib/async.js:128:19)
    at /Users/Me/projects/superscript-editor/node_modules/superscript/node_modules/async/lib/async.js:25:16
    at /Users/Me/projects/superscript-editor/node_modules/superscript/node_modules/async/lib/async.js:237:17
    at Promise.<anonymous> (/Users/Me/projects/superscript-editor/node_modules/superscript/lib/topics/topic.js:65:9)
    at Promise.<anonymous> (/Users/Me/projects/superscript-editor/node_modules/mongoose/node_modules/mpromise/lib/promise.js:177:8)
    at Promise.emit (events.js:95:17)
    at Promise.emit (/Users/Me/projects/superscript-editor/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)
    at Promise.fulfill (/Users/Me/projects/superscript-editor/node_modules/mongoose/node_modules/mpromise/lib/promise.js:97:20)
    at /Users/Me/projects/superscript-editor/node_modules/mongoose/lib/query.js:1406:13
    at model.Document.init (/Users/Me/projects/superscript-editor/node_modules/mongoose/lib/document.js:254:11)
    at completeOne (/Users/Me/projects/superscript-editor/node_modules/mongoose/lib/query.js:1404:10)
    at Object.cb (/Users/Me/projects/superscript-editor/node_modules/mongoose/lib/query.js:1158:11)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions