Skip to content

Commit b48e6b4

Browse files
committed
Feedback.
1 parent 5eed2a8 commit b48e6b4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/local/LocalDocumentsView.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,11 @@ IndexManager getIndexManager() {
9191
*/
9292
Document getDocument(DocumentKey key) {
9393
Mutation overlay = documentOverlayCache.getOverlay(key);
94-
MutableDocument document = overlay instanceof PatchMutation ?
95-
remoteDocumentCache.get(key) : MutableDocument.newInvalidDocument(key);
94+
MutableDocument document =
95+
(overlay == null || overlay instanceof PatchMutation)
96+
? remoteDocumentCache.get(key)
97+
: MutableDocument.newInvalidDocument(key);
98+
if (overlay != null) {
9699
overlay.applyToLocalView(document, null, Timestamp.now());
97100
}
98101

firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteRemoteDocumentCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public Map<DocumentKey, MutableDocument> getAll(
166166
if (collections.isEmpty()) {
167167
return Collections.emptyMap();
168168
} else if (BINDS_PER_STATEMENT * collections.size() < SQLitePersistence.MAX_ARGS) {
169-
return getAll(collections, offset, limit, new HashSet<>());
169+
return getAll(collections, offset, limit, Collections.emptySet());
170170
} else {
171171
// We need to fan out our collection scan since SQLite only supports 999 binds per statement.
172172
Map<DocumentKey, MutableDocument> results = new HashMap<>();

0 commit comments

Comments
 (0)