Skip to content

TypeError: Cannot read property 'forEach' of null #26

@stovenator

Description

@stovenator

This occurs only when you have a stop word, followed by multiple spaces, and then followed by a stop word.

For example:

> rake.generate("Please elaborate on planets of    the")
TypeError: Cannot read property 'forEach' of null
    at phraseList.forEach (/Users/mastover/git/rake-test/node_modules/node-rake/index.js:75:16)
    at Array.forEach (<anonymous>)
    at Rake.calculatePhraseScores (/Users/mastover/git/rake-test/node_modules/node-rake/index.js:71:16)
    at Rake.generate (/Users/mastover/git/rake-test/node_modules/node-rake/index.js:89:31)
    at Object.generate (/Users/mastover/git/rake-test/node_modules/node-rake/app.js:13:21)
> rake.generate("Please elaborate on planets   of the")
[ 'elaborate', 'planets' ]
> rake.generate("Please elaborate on     planets   of the")
[ 'elaborate', 'planets' ]

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