convergencelabs / convergence-project

The project used for Convergence Project Management and Issue Reporting
https://convergence.io
42 stars 5 forks source link

Model Query with projection for field that doesn't exist causes null pointer. #196

Closed mmacfadden closed 3 years ago

mmacfadden commented 3 years ago

Versions

Describe the Bug If you query models using a projection and a model does not have a particular field a NullPointerException is thrown:

java.lang.NullPointerException: null
    at com.convergencelabs.convergence.server.backend.datastore.domain.model.mapper.DataValueMapper$.oDocumentToDataValue(DataValueMapper.scala:42) ~[classes/:?]
    at com.convergencelabs.convergence.server.backend.datastore.domain.model.ModelStore.$anonfun$modelDataQuery$4(ModelStore.scala:282) ~[classes/:?]
    at scala.Function$.$anonfun$tupled$1(Function.scala:76) ~[scala-library-2.13.5.jar:?]
    at scala.collection.immutable.List.map(List.scala:246) ~[scala-library-2.13.5.jar:?]
    at com.convergencelabs.convergence.server.backend.datastore.domain.model.ModelStore.$anonfun$modelDataQuery$3(ModelStore.scala:281) ~[classes/:?]
    at scala.collection.immutable.List.map(List.scala:246) ~[scala-library-2.13.5.jar:?]
    at com.convergencelabs.convergence.server.backend.datastore.domain.model.ModelStore.$anonfun$modelDataQuery$1(ModelStore.scala:264) ~[classes/:?]
    at scala.util.Success.map(Try.scala:262) ~[scala-library-2.13.5.jar:?]

Step To Reproduce

  1. Create a model.
  2. Query the collection for a model with a projection containing field that does not exist.

Expected Behavior The field should just be omitted.

mmacfadden commented 3 years ago

@ toebes I believe you were seeing this and reported it on slack.