KomodoOpenLab / tagin

tagin! is an open source, location tagging engine that may be used to create indoor location-based services (LBS) and applications.
http://wiki.mobile-accessibility.idrc.ocad.ca/w/Tagin!
4 stars 4 forks source link

Null pointer exception on CloudActivity (mReceiver) #28

Closed ijdoc closed 11 years ago

ijdoc commented 11 years ago

trace...

08-28 11:25:34.136: E/AndroidRuntime(12073): FATAL EXCEPTION: main
08-28 11:25:34.136: E/AndroidRuntime(12073): java.lang.RuntimeException: Error receiving broadcast Intent { act=ca.idrc.tagin.lib.ACTION_URN_READY flg=0x10 (has extras) } in ca.idrc.tagin.cloud.CloudActivity$1@42c4be20
08-28 11:25:34.136: E/AndroidRuntime(12073):    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:773)
08-28 11:25:34.136: E/AndroidRuntime(12073):    at android.os.Handler.handleCallback(Handler.java:730)
08-28 11:25:34.136: E/AndroidRuntime(12073):    at android.os.Handler.dispatchMessage(Handler.java:92)
08-28 11:25:34.136: E/AndroidRuntime(12073):    at android.os.Looper.loop(Looper.java:137)
08-28 11:25:34.136: E/AndroidRuntime(12073):    at android.app.ActivityThread.main(ActivityThread.java:5103)
08-28 11:25:34.136: E/AndroidRuntime(12073):    at java.lang.reflect.Method.invokeNative(Native Method)
08-28 11:25:34.136: E/AndroidRuntime(12073):    at java.lang.reflect.Method.invoke(Method.java:525)
08-28 11:25:34.136: E/AndroidRuntime(12073):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
08-28 11:25:34.136: E/AndroidRuntime(12073):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-28 11:25:34.136: E/AndroidRuntime(12073):    at dalvik.system.NativeStart.main(Native Method)
08-28 11:25:34.136: E/AndroidRuntime(12073): Caused by: java.lang.NullPointerException
08-28 11:25:34.136: E/AndroidRuntime(12073):    at ca.idrc.tagin.cloud.CloudActivity$1.onReceive(CloudActivity.java:178)
08-28 11:25:34.136: E/AndroidRuntime(12073):    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:763)
08-28 11:25:34.136: E/AndroidRuntime(12073):    ... 9 more
ijdoc commented 11 years ago

This exception occurred when no tags were yet available AND when one tag was available after some gesturing.

ijdoc commented 11 years ago

Happened again when trying to get a screenshot for another bug report... this issue should go to the top of the bug fixing queue

ijdoc commented 11 years ago

Surrounding intent with 'hasExtra()' test to skip action if null extra. Will commit if it fixes the issue

ijdoc commented 11 years ago

@elyas-bhy said:

I think it should be: if (urn != null) because the extra is always there it's just that the server returns a null value when it encounters a problem either way, I'm not able to reproduce this bug... you're getting this during startup, right?

ijdoc commented 11 years ago

@elyas-bhy I haven't had the null pointer exception since f63cd96 so I don't know if that is the issue. I am getting the issue after 'initialization' sometimes right away and sometimes after performing a few gestures, which mostly have no effect on the UI as described in #33

ijdoc commented 11 years ago

@elyas-bhy seems you are right... I just got the NPE again. Do you want to make the changes or should I?

elyas-bhy commented 11 years ago

@jorgesilva I'm on it

elyas-bhy commented 11 years ago

@jorgesilva https://github.com/idrc/tagin/pull/36