Exception: cannot construct Atom(null)
We've run across a situation using 2.4-M2 where the following exception occurs with no stack trace and the UI hangs:
[pool-2-thread-5] ERROR net.liftweb.util.Schedule - java.lang.IllegalArgumentException: cannot construct Atom(null)
Winnowing it down...
def all(in: NodeSeq): NodeSeq = page.flatMap(item =>
bind("item", in,
"starRating" -> (if (item.hotel.diamondRating == null) "" else item.hotel.diamondRating)
)
)
The startRating line used to be just
"starRating" -> item.hotel.diamondRating
but when some data showed up unexpectedly dirty, diamondRating can be null when it should instead be blank.
See discussion at http://groups.google.com/group/liftweb/browse_thread/thread/eb91f34edd5451c3/bba1623e717460ec#bba1623e717460ec
[pool-2-thread-5] ERROR net.liftweb.util.Schedule - java.lang.IllegalArgumentException: cannot construct Atom(null)
Winnowing it down...
def all(in: NodeSeq): NodeSeq = page.flatMap(item =>
bind("item", in,
"starRating" -> (if (item.hotel.diamondRating == null) "" else item.hotel.diamondRating)
)
)
The startRating line used to be just
"starRating" -> item.hotel.diamondRating
but when some data showed up unexpectedly dirty, diamondRating can be null when it should instead be blank.
See discussion at http://groups.google.com/group/liftweb/browse_thread/thread/eb91f34edd5451c3/bba1623e717460ec#bba1623e717460ec
Leave a comment
(In revision:e1cf30cd737010e058ca4b4d07110defbc2ef093) Closes #1091. Better null testing and better Elem testing for bind() and CSS Selector Transforms
Branch: master
Branch: master