nightscout / android-uploader

nightscout android uploader
GNU General Public License v3.0
66 stars 118 forks source link

Pebble class NPEs occasionally #142

Closed trhodeos closed 9 years ago

trhodeos commented 9 years ago

PebbleKit expects the context to be non-null (as it should). I believe this issue is similar to #135

Example stack trace: java.lang.RuntimeException: Error receiving broadcast Intent { act=com.mSyncingServiceIntent.action.PROCESS_RESPONSE cat=[android.intent.category.DEFAULT] flg=0x10 (has extras) } in com.nightscout.android.MainActivity$CGMStatusReceiver@42e4b890 at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:782) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:212) at android.app.ActivityThread.main(ActivityThread.java:5135) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at android.os.Parcel.readException(Parcel.java:1483) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137) at android.content.ContentProviderProxy.query(ContentProviderNative.java:424) at android.content.ContentResolver.query(ContentResolver.java:465) at android.content.ContentResolver.query(ContentResolver.java:408) at com.getpebble.android.kit.PebbleKit.isWatchConnected(PebbleKit.java:101) at com.nightscout.android.wearables.Pebble.sendDownload(Pebble.java:105) at com.nightscout.android.wearables.Pebble.sendDownload(Pebble.java:95) at com.nightscout.android.wearables.Pebble.sendDownload(Pebble.java:65) at com.nightscout.android.MainActivity$CGMStatusReceiver.onReceive(MainActivity.java:383) at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:772) ... 9 more java.lang.NullPointerException at android.os.Parcel.readException(Parcel.java:1483) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137) at android.content.ContentProviderProxy.query(ContentProviderNative.java:424) at android.content.ContentResolver.query(ContentResolver.java:465) at android.content.ContentResolver.query(ContentResolver.java:408) at com.getpebble.android.kit.PebbleKit.isWatchConnected(PebbleKit.java:101) at com.nightscout.android.wearables.Pebble.sendDownload(Pebble.java:105) at com.nightscout.android.wearables.Pebble.sendDownload(Pebble.java:95) at com.nightscout.android.wearables.Pebble.sendDownload(Pebble.java:65) at com.nightscout.android.MainActivity$CGMStatusReceiver.onReceive(MainActivity.java:383) at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:772) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:212) at android.app.ActivityThread.main(ActivityThread.java:5135) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693) at dalvik.system.NativeStart.main(Native Method)