Skip to content

Parser is setting 'parsed' variable to undefined, then trying to find it's length. #404

@joshfarrant

Description

@joshfarrant

I've recently noticed a few errors coming from the Parser module.

TypeError: Cannot read property 'length' of undefined

It appears that these are the offending lines for most of these cases, however the same issue is repeated a few times in that module. The issue is as follows:

if (parsed === -1) {
  parsed = undefined;
}

length = parsed.length;

If parsed is set to -1, then it will be reassigned to undefined, and so will throw the above error when trying to read it's length.

I'd be happy to submit a PR to fix this issue if that would be beneficial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions