hakandilek / play2-crud

Simple CRUD & DAO implementation for play2
Other
142 stars 52 forks source link

java.lang.NullPointerException when attempting to edit entity #60

Closed risenhoover closed 9 years ago

risenhoover commented 9 years ago

I'm getting a NullPointerException when I attempt to edit a record. I believe this is due to the fact that my keys are UUIDs. I am able to successfully edit entities that use a Long as a Key, but all my other entities use UUIDs and get this error.

Here is where the error occurs: public Result show(String key) { Object k = this.keyConverter.convert(key); return this.delegate.read(k); }

I believe this.keyConverter == null;

Here is the stack trace:

Caused by: java.lang.NullPointerException: null at play.utils.crud.ControllerProxy.show(ControllerProxy.java:30) ~[play2-crud_2.11-0.7.4-SNAPSHOT.jar:0.7.4-SNAPSHOT] at play.utils.crud.RouterController.show(RouterController.java:76) ~[play2-crud_2.11-0.7.4-SNAPSHOT.jar:0.7.4-SNAPSHOT] at play.crud.Routes$$anonfun$routes$1$$anonfun$applyOrElse$5$$anonfun$apply$39.apply(routes_routing.scala:174) ~[play2-crud_2.11-0.7.4-SNAPSHOT.jar:0.7.4-SNAPSHOT] at play.crud.Routes$$anonfun$routes$1$$anonfun$applyOrElse$5$$anonfun$apply$39.apply(routes_routing.scala:174) ~[play2-crud_2.11-0.7.4-SNAPSHOT.jar:0.7.4-SNAPSHOT] at play.core.Router$HandlerInvokerFactory$$anon$4.resultCall(Router.scala:264) ~[play_2.11-2.3.8.jar:2.3.8]

hakandilek commented 9 years ago

Fixed by #61