Skip to content

TypeError: Cannot read property 'toString' of null #510

@robvenn

Description

@robvenn

When trying to add a query parameter with an operator like "?createdAt_like=1491402693000" and the JSON data contains null values, this error is thrown in node_modules/json-server/lib/server/router/plural.js:122:64. Any of those elementValue.toString() calls could throw if they are tested against null.

I also noticed there is probably no way to use _like or _ne with null as value because there's no way to distinguish it from the string "null".

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