Skip to content

Commit 433de1a

Browse files
committed
Revert "fix: live query server crashing due to missing __type being accessed on undefined"
This reverts commit 31c41cb.
1 parent 31c41cb commit 433de1a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/LiveQuery/QueryTools.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,7 @@ function contains(haystack: Array, needle: any): boolean {
9999
if (typeof ptr === 'string' && ptr === needle.objectId) {
100100
return true;
101101
}
102-
if (
103-
ptr &&
104-
ptr.className &&
105-
ptr.className === needle.className &&
106-
ptr.objectId === needle.objectId
107-
) {
102+
if (ptr.className === needle.className && ptr.objectId === needle.objectId) {
108103
return true;
109104
}
110105
}
@@ -217,7 +212,6 @@ function matchesKeyConstraints(object, key, constraints) {
217212
return equalObjectsGeneric(object[key], constraints, function (obj, ptr) {
218213
return (
219214
typeof obj !== 'undefined' &&
220-
obj !== null &&
221215
ptr.className === obj.className &&
222216
ptr.objectId === obj.objectId
223217
);
@@ -229,7 +223,7 @@ function matchesKeyConstraints(object, key, constraints) {
229223
// More complex cases
230224
for (var condition in constraints) {
231225
compareTo = constraints[condition];
232-
if (compareTo?.__type) {
226+
if (compareTo.__type) {
233227
compareTo = Parse._decode(key, compareTo);
234228
}
235229
switch (condition) {

0 commit comments

Comments
 (0)