bmatthias / kolab-android

Automatically exported from code.google.com/p/kolab-android
Other
0 stars 0 forks source link

NullPointerException on Sync All (kolab-android 0.0.4, Froyo) #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Clicking "Sync All" in kolab-android 0.0.4 on Froyo gives a 
NullPointerException. The error is reproducible. "Sync Calendar only" works 
fine.

adb logcat:

Please provide any additional information below.
I/Service ( 3763): starting service
I/Service ( 3763): Service started
I/Service ( 3763): starting sync
W/System.err( 3763): java.lang.NullPointerException
W/System.err( 3763):    at 
at.dasz.KolabDroid.ContactsContract.SyncContactsHandler.fetchAllLocalItems(SyncC
ontactsHandler.java:145)
W/System.err( 3763):    at 
at.dasz.KolabDroid.Sync.SyncWorker.sync(SyncWorker.java:186)
W/System.err( 3763):    at 
at.dasz.KolabDroid.Sync.SyncWorker.runWorker(SyncWorker.java:99)
W/System.err( 3763):    at 
at.dasz.KolabDroid.Sync.BaseWorker.start(BaseWorker.java:65)
W/System.err( 3763):    at 
at.dasz.KolabDroid.Sync.SyncService.doWakefulWork(SyncService.java:61)
W/System.err( 3763):    at 
com.commonsware.cwac.wakeful.WakefulIntentService.onHandleIntent(WakefulIntentSe
rvice.java:79)
W/System.err( 3763):    at 
android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)
W/System.err( 3763):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err( 3763):    at android.os.Looper.loop(Looper.java:123)
W/System.err( 3763):    at android.os.HandlerThread.run(HandlerThread.java:60)
I/Service ( 3763): sync finished
I/Service ( 3763): Service stopped

Original issue reported on code.google.com by alvarqu...@gmail.com on 14 Dec 2010 at 11:39

GoogleCodeExporter commented 8 years ago
Strange, looks like loadItem returns null. This can only happen, if there is a 
Contact without any data.

String where = ContactsContract.Data.RAW_CONTACT_ID + "=?";
queryCursor = cr.query(ContactsContract.Data.CONTENT_URI, projection,
                    where, new String[] { Integer.toString(id) }, null);

if (!queryCursor.moveToFirst()) return null;

Original comment by arthur.z...@gmail.com on 15 Dec 2010 at 12:29