cgeo/c-geo-opensource — Issue #1151: Clicking "Spotted in" on trackable screen can give Exception
Author: campbeb
Created: 2012-02-20 03:08:42+00:00
State: open

This is not always reproduceable. I think it depends on if cache is in CacheCache or DB, etc.

Steps:
- View a cache that has trackables
- View one of the trackables
- Click on the "Spotted in" to search for the cache (in this case it will be the same cache we are already viewing)
- Sometimes you can get IllegalArgumentException (geocode must not be empty) from `cgData.loadCache`

I was never able to reproduce this if I started off by searching for a trackable (vice starting off in a cache). I was able to cause it several times in a row with one cache and then it started working fine.

02-20 11:35:53.617: W/dalvikvm(2227): threadid=1: thread exiting with uncaught exception (group=0x4001d7d8)
02-20 11:35:53.617: E/AndroidRuntime(2227): FATAL EXCEPTION: main
02-20 11:35:53.617: E/AndroidRuntime(2227): java.lang.IllegalArgumentException: geocode must not be empty
02-20 11:35:53.617: E/AndroidRuntime(2227):	at cgeo.geocaching.cgData.loadCache(cgData.java:1807)
02-20 11:35:53.617: E/AndroidRuntime(2227):	at cgeo.geocaching.cgeoapplication.loadCache(cgeoapplication.java:516)
02-20 11:35:53.617: E/AndroidRuntime(2227):	at cgeo.geocaching.SearchResult.getFirstCacheFromResult(SearchResult.java:163)
02-20 11:35:53.617: E/AndroidRuntime(2227):	at cgeo.geocaching.CacheDetailActivity.notifyDataSetChanged(CacheDetailActivity.java:626)
02-20 11:35:53.617: E/AndroidRuntime(2227):	at cgeo.geocaching.CacheDetailActivity.access$2(CacheDetailActivity.java:621)
02-20 11:35:53.617: E/AndroidRuntime(2227):	at cgeo.geocaching.CacheDetailActivity$LoadCacheHandler.handleRegularMessage(CacheDetailActivity.java:604)
02-20 11:35:53.617: E/AndroidRuntime(2227):	at cgeo.geocaching.utils.CancellableHandler.handleMessage(CancellableHandler.java:32)
02-20 11:35:53.617: E/AndroidRuntime(2227):	at android.os.Handler.dispatchMessage(Handler.java:99)
02-20 11:35:53.617: E/AndroidRuntime(2227):	at android.os.Looper.loop(Looper.java:123)
02-20 11:35:53.617: E/AndroidRuntime(2227):	at android.app.ActivityThread.main(ActivityThread.java:4680)
02-20 11:35:53.617: E/AndroidRuntime(2227):	at java.lang.reflect.Method.invokeNative(Native Method)
02-20 11:35:53.617: E/AndroidRuntime(2227):	at java.lang.reflect.Method.invoke(Method.java:521)
02-20 11:35:53.617: E/AndroidRuntime(2227):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
02-20 11:35:53.617: E/AndroidRuntime(2227):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
02-20 11:35:53.617: E/AndroidRuntime(2227):	at dalvik.system.NativeStart.main(Native Method)