Skip to content

Receiving a HTTP 500 when using a distinct query on nullable field #4540

Closed
@j-koenig

Description

@j-koenig

Issue Description

Parse-Server responds with a HTTP 500 when using a distinct query on the _User table using a field which is set to null on one or more objects.

Steps to reproduce

Setup a new parse-server instance and add a field of the type String to the table. Create a new user and set the newly created field to null for the new user. Use the new distinct query feature on that field.

Expected Results

The server should return an array with all distinct strings

Actual Outcome

The server responds with a HTTP 500

Environment Setup

  • Server

    • parse-server version: 2.7.2
    • Operating System: Amazon Linux 2017.09 v4.4.4
    • Hardware: EC2 t2.micro
    • Localhost or remote server: AWS
  • Database

    • MongoDB version: 3.2.13
    • Storage engine: wiredTiger
    • Hardware: EC2 t2.micro
    • Localhost or remote server: AWS

Logs/Trace

Uncaught internal server error. TypeError: Cannot convert undefined or null to object
    at cleanResultOfSensitiveUserInfo (/var/app/current/node_modules/parse-server/lib/RestQuery.js:422:10)
    at config.database.find.then.results (/var/app/current/node_modules/parse-server/lib/RestQuery.js:499:9)
    at process._tickDomainCallback (internal/process/next_tick.js:135:7) TypeError: Cannot convert undefined or null to object
    at cleanResultOfSensitiveUserInfo (/var/app/current/node_modules/parse-server/lib/RestQuery.js:422:10)
    at config.database.find.then.results (/var/app/current/node_modules/parse-server/lib/RestQuery.js:499:9)
    at process._tickDomainCallback (internal/process/next_tick.js:135:7)

Metadata

Metadata

Assignees

Labels

type:bugImpaired feature or lacking behavior that is likely assumed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions