NullPointerException when a value is null on the session

Hello,

With Play 2.6.12 (Java), an exception is throw when a field in the session() is set to null.

[warn] p.a.m.DefaultJWTCookieDataCodec - decode: could not decode JWT: null
java.lang.NullPointerException: null
	at play.api.mvc.JWTCookieDataCodec.$anonfun$decode$7(Cookie.scala:595)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
	at scala.collection.Iterator.foreach(Iterator.scala:929)
	at scala.collection.Iterator.foreach$(Iterator.scala:929)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1417)
	at scala.collection.IterableLike.foreach(IterableLike.scala:71)
	at scala.collection.IterableLike.foreach$(IterableLike.scala:70)
	at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
	at scala.collection.TraversableLike.map(TraversableLike.scala:234)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:227)

Hi @0xbaadf00d,

The problem was reported at playframework/playframework#8114, and there is a pull request already: playframework/playframework#8141.

You may want to join the discussion if you think the PR above doesn’t fix the problem for you. :slight_smile: