Skip to content

Commit 6ccc9de

Browse files
authored
Key comparison for RTDB queries should correctly handle boundary sentinels (#2328)
1 parent 86b411c commit 6ccc9de

File tree

1 file changed

+2
-2
lines changed
  • firebase-database/src/main/java/com/google/firebase/database/snapshot

1 file changed

+2
-2
lines changed

firebase-database/src/main/java/com/google/firebase/database/snapshot/ChildKey.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ protected int intValue() {
7171
public int compareTo(ChildKey other) {
7272
if (this == other) {
7373
return 0;
74-
} else if (this == MIN_KEY || other == MAX_KEY) {
74+
} else if (this.key.equals(MIN_KEY_NAME) || other.key.equals(MAX_KEY_NAME)) {
7575
return -1;
76-
} else if (other == MIN_KEY || this == MAX_KEY) {
76+
} else if (other.key.equals(MIN_KEY_NAME) || this.key.equals(MAX_KEY_NAME)) {
7777
return 1;
7878
} else if (this.isInt()) {
7979
if (other.isInt()) {

0 commit comments

Comments
 (0)