Bean list entry with empty property is saved as null value

36 views
Skip to first unread message

rohitv...@gmail.com

unread,
Jul 26, 2013, 8:13:56 AM7/26/13
to openmobs...@googlegroups.com
Hi Sohil,

I am trying to read the beanList from the bean with one of its' entry's property set to empty value " ". However, after calling save() on MobileBean, it modifies that property to null.

Hence, while trying to readList on the MobileBean, it crashes with the following exception:

java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:365)
    at org.openmobster.android.api.sync.MobileBean.port(MobileBean.java:1193)
    at org.openmobster.android.api.sync.MobileBean.readList(MobileBean.java:265)

So, is it mandatory to set each property with value having string length greater than zero. Could you please guide on how to avoid this?

Regards
Rohit

Sohil Shah

unread,
Jul 29, 2013, 8:54:54 PM7/29/13
to openmobs...@googlegroups.com
Hi Rohit,

Sorry for my late reply. I think I ran into this bug earlier and fixed it on the active branch. I will test this scenario on the active branch and let you know for sure. If not, I will have to fix this bug.

The only way to avoid this issue is to use a non-zero length string and then trim the value when you read it on the client and the server. I know that is a hackish workaround.

This issue will go away when 2.4-M3 is released. In the meantime, can you enter this as an issue so that it does not fall through the cracks.

Thanks
Sohil



Rohit

--
You received this message because you are subscribed to the Google Groups "OpenMobster Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openmobster-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

rohitv...@gmail.com

unread,
Jul 30, 2013, 5:06:40 AM7/30/13
to openmobs...@googlegroups.com
Hi Sohil,

Thanks for the reply.
Any timelines for when 2.4-M3 would be released.

Thanks
Rohit
Reply all
Reply to author
Forward
0 new messages