Skip to content

Commit

Permalink
Catch sqlite exceptions when filter entities
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Feb 11, 2025
1 parent 1810c8d commit 565f8c2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.odk.collect.entities.javarosa.filter

import android.database.sqlite.SQLiteException
import org.javarosa.core.model.CompareToNodeExpression
import org.javarosa.core.model.condition.EvaluationContext
import org.javarosa.core.model.condition.FilterStrategy
Expand Down Expand Up @@ -41,7 +42,11 @@ class LocalEntitiesFilterStrategy(entitiesRepository: EntitiesRepository) :
val query = xPathExpressionToQuery(predicate, sourceInstance, evaluationContext)

return if (query != null) {
queryToTreeReferences(query, sourceInstance)
try {
queryToTreeReferences(query, sourceInstance)
} catch (e: SQLiteException) {
next.get()
}
} else {
next.get()
}
Expand Down

0 comments on commit 565f8c2

Please sign in to comment.