Skip to content

Assigning topic crashes the editor #29

@siddharthg

Description

@siddharthg

When I add a gambit to a newly created topic, it crashes the node and give me the following error. I could reproduce the same multiple types.

/Users/siddharthgupta/git/superscript-editor/node_modules/superscript/lib/topics/sort.js:108
        var kind_sorted = Object.keys(track[ip][kind]).sort(function(a,b) { re
                                               ^
TypeError: Cannot read property 'qtype' of undefined
    at Object.exports.sortTriggerSet (/Users/siddharthgupta/git/superscript-editor/node_modules/superscript/lib/topics/sort.js:108:48)
    at /Users/siddharthgupta/git/superscript-editor/node_modules/superscript/lib/topics/topic.js:70:26
    at /Users/siddharthgupta/git/superscript-editor/node_modules/superscript/node_modules/async/lib/async.js:240:13
    at async.each (/Users/siddharthgupta/git/superscript-editor/node_modules/superscript/node_modules/async/lib/async.js:114:20)
    at _asyncMap (/Users/siddharthgupta/git/superscript-editor/node_modules/superscript/node_modules/async/lib/async.js:234:9)
    at Object.map (/Users/siddharthgupta/git/superscript-editor/node_modules/superscript/node_modules/async/lib/async.js:212:23)
    at model.topicSchema.methods.sortGambits (/Users/siddharthgupta/git/superscript-editor/node_modules/superscript/lib/topics/topic.js:69:11)
    at Immediate.<anonymous> (/Users/siddharthgupta/git/superscript-editor/controllers/gambits.js:140:25)
    at Immediate._onImmediate (/Users/siddharthgupta/git/superscript-editor/node_modules/mongoose/node_modules/mquery/lib/utils.js:137:16)
    at processImmediate [as _immediateCallback] (timers.js:367:17)

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