Skip to content
This repository was archived by the owner on Jan 17, 2019. It is now read-only.
This repository was archived by the owner on Jan 17, 2019. It is now read-only.

Null and 0 comparison should probably not evaluate to true #6

@mickmuzac

Description

@mickmuzac

The snippet below works as expected.

data.where('result.score.raw > 0').orderBy('result.score.raw');
data.where('result.score.raw >= 0 and result.score.raw != null').orderBy('result.score.raw');

However this:
data.where('result.score.raw >= 0').orderBy('result.score.raw');

Results in:
xapicollection.js:698 Uncaught TypeError: Cannot read property 'toLowerCase' of null.

Which leads me to believe that the Collection class evaluates 0 == null to true and includes statements with null (or undefined?) score values in the resultant collection. This should probably not happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions