I’ve been playing around with the trial version of CoronaCards for Android. It’s very impressive. I’m planning to use it for a real project, but I’ve run into a strange issue when sending events from Java to Lua. The crash I’m getting results in:
10-16 19:38:11.214: W/System.err(21339): java.lang.NullPointerException
10-16 19:38:11.214: W/System.err(21339): at com.ansca.corona.CoronaLua.pushHashtable(CoronaLua.java:271)
10-16 19:38:11.214: W/System.err(21339): at com.ansca.corona.CoronaView.sendEvent(CoronaView.java:190)
Because I cannot see the source code of CoronaLua.pushHashtable, I cannot see what is causing the NullPointerException. Can one of the devs help here please? I can’t figure out how to fix it because I don’t even know where to begin looking without knowing what is null.
Here is my Java code that causes it:
Hashtable<Object, Object> ht = new Hashtable<Object, Object>();
ht.put(“name”, “appsUpdated”);
mSendingView.sendEvent(ht);
And strangely, if I comment out the ht.put(), and send an empty Hashtable, the NullPointerException doesn’t happen. But of course, an empty hashtable is not useful.
One more clue - a few times, the crash didn’t occur even when sending real data, so it seems like possibly some sort of race condition in the CoronaCards Android code.