@@ -68,7 +68,7 @@ final class SQLiteIndexManager implements IndexManager {
68
68
69
69
private final SQLitePersistence db ;
70
70
private final LocalSerializer serializer ;
71
- private final User user ;
71
+ private final String uid ;
72
72
private final Map <String , Map <Integer , FieldIndex >> memoizedIndexes ;
73
73
74
74
private boolean started = false ;
@@ -77,7 +77,7 @@ final class SQLiteIndexManager implements IndexManager {
77
77
SQLiteIndexManager (SQLitePersistence persistence , LocalSerializer serializer , User user ) {
78
78
this .db = persistence ;
79
79
this .serializer = serializer ;
80
- this .user = user ;
80
+ this .uid = user . isAuthenticated () ? user . getUid () : "" ;
81
81
this .memoizedIndexes = new HashMap <>();
82
82
}
83
83
@@ -376,7 +376,7 @@ private void addSingleEntry(
376
376
"INSERT INTO index_entries (index_id, uid, array_value, directional_value, document_name) "
377
377
+ "VALUES(?, ?, ?, ?, ?)" ,
378
378
indexId ,
379
- user . getUid () ,
379
+ uid ,
380
380
arrayValue ,
381
381
directionalValue ,
382
382
document .getKey ().toString ());
@@ -504,7 +504,7 @@ private Object[] fillBounds(
504
504
int offset = 0 ;
505
505
for (int i = 0 ; i < statementCount ; ++i ) {
506
506
bindArgs [offset ++] = indexId ;
507
- bindArgs [offset ++] = user . getUid () ;
507
+ bindArgs [offset ++] = uid ;
508
508
if (arrayValues != null ) {
509
509
bindArgs [offset ++] = encodeSingleElement (arrayValues .get (i / statementsPerArrayValue ));
510
510
}
0 commit comments