On Oct 29, 2007, at 1:56 PM, Jacopo Cappellato wrote:

David E Jones wrote:
On Oct 29, 2007, at 11:47 AM, Jacopo Cappellato wrote:
the bug is fixed in rev. 589769
It was caused by old code not working well after the very recent framework updates.
I looked at your commit on this and am wondering what the framework update was that caused this problem, mainly because it might cause similar problems in other places... It might be something we want to add some code to in order to keep it backward compatible.
-David

The offending instructions were in the screen action:

<set field="lastFinishedJob" from-field="mrpFinishedJobs[0]"/>
<set field="lastFinishedJobs[]" from-field="lastFinishedJob"/>

If mrpFinishedJobs is empty or null then also lastFinishedJob is null and so in the second line a null value is inserted into the list.

In the old framework this seemed to work fine: the lastFinishedJobs list was empty and so no rows were shown in the list form. In the new framework, I guess, lastFinishedJobs was filled with a null object and this was causing a NPE...

Does it make sense?

However it is easy to recreate...

This is an interesting issue... I'm wondering when this changed. The NPE probably comes from trying to put it into a FastList, which doesn't allow null entries.

I'm thinking of a couple of improvements:

1. in the FlexibleMapAccessor check for nulls before adding to list and just not do it

2. add the set-if-null and set-if-empty attributes to the screen action set just like the simple-method set operation, with the same defaults (false for null, true for empty)

I think I'll do #1, or look into it, right away. That way at least adding to a list won't blow up (which is silly).

-David

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to