web-dev-qa-db-fra.com

IllegalArgumentException: la valeur de liaison à l'index 1 est nulle

Quelqu'un sait-il ce que cela signifie?

12-31 20:55:45.861: ERROR/AndroidRuntime(12478): Caused by: Java.lang.IllegalArgumentException: the bind value at index 1 is null
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at Android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.Java:234)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at Android.database.sqlite.SQLiteQuery.bindString(SQLiteQuery.Java:182)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at Android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.Java:48)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at Android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.Java:1345)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at Android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.Java:330)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at Android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.Java:280)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.providers.ProductContentProvider.query(ProductContentProvider.Java:350)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at Android.content.ContentProvider$Transport.query(ContentProvider.Java:163)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at Android.content.ContentResolver.query(ContentResolver.Java:245)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.providers.FacadeContentProvider.query(FacadeContentProvider.Java:563)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at Android.content.ContentProvider$Transport.query(ContentProvider.Java:163)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at Android.content.ContentResolver.query(ContentResolver.Java:245)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.util.ScanAddTask.existsProduct(ScanAddTask.Java:164)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.util.ScanAddTask.<init>(ScanAddTask.Java:71)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.util.ItemScanAddTask.<init>(ItemScanAddTask.Java:34)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.ui.activities.collections.cd.CDCollectionViewWindow$MusicCDItemScanAddTask.<init>(CDCollectionViewWindow.Java:147)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.ui.activities.collections.cd.CDCollectionViewWindow.restoreLocalState(CDCollectionViewWindow.Java:1044)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.ui.activities.collections.cd.CDCollectionViewWindow.onRestoreInstanceState(CDCollectionViewWindow.Java:966)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at Android.app.Activity.performRestoreInstanceState(Activity.Java:815)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at Android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.Java:1096)
12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at Android.app.ActivityThread.performLaunchActivity(ActivityThread.Java:2641)
64
pjv

The bind value Fait apparemment référence à selectionArgs pour la sélection, que vous insérez dans query(). Si une telle valeur de selectionArgs est null, vous obtenez ceci.

183
pjv

@Gray et @pjv la réponse était le point pour réaliser quel problème a causé cette erreur. Vous devez être prudent avec la sélection et la correspondance selectionArgs, si vous passez selection = null et selectionArgs = something, vous obtiendrez également cette erreur! :) Merci!

2
cesards