Skip to content

Commit da0a9f8

Browse files
authored
Merge pull request #46 from devshackio/master
Fix startAt, endAt, equalTo optional 2nd params on Android
2 parents d573cc6 + 6ef8510 commit da0a9f8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

android/src/main/java/io/fullstack/firestack/FirestackDatabase.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -641,23 +641,23 @@ private Query getDatabaseQueryAtPathAndModifiers(
641641
query = query.limitToFirst(limit);
642642
} else if (methStr.contains("equalTo")) {
643643
String value = strArr[1];
644-
String key = strArr[2];
644+
String key = strArr.length >= 3 ? strArr[2] : null;
645645
if (key == null) {
646646
query = query.equalTo(value);
647647
} else {
648648
query = query.equalTo(value, key);
649649
}
650650
} else if (methStr.contains("endAt")) {
651651
String value = strArr[1];
652-
String key = strArr[2];
652+
String key = strArr.length >= 3 ? strArr[2] : null;
653653
if (key == null) {
654654
query = query.endAt(value);
655655
} else {
656656
query = query.endAt(value, key);
657657
}
658658
} else if (methStr.contains("startAt")) {
659659
String value = strArr[1];
660-
String key = strArr[2];
660+
String key = strArr.length >= 3 ? strArr[2] : null;
661661
if (key == null) {
662662
query = query.startAt(value);
663663
} else {

0 commit comments

Comments
 (0)