diff options
author | Sebastian Schmidt <mrschmidt@google.com> | 2018-06-12 10:58:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-12 10:58:35 -0700 |
commit | afea8d5aacf474b57b4364feda08be9ca195594b (patch) | |
tree | d43c39ae9f71e88d256012f4467cd2b707fc7ddd /Firestore/Example/Tests/SpecTests/FSTSpecTests.mm | |
parent | 0db8ef7dbe6c8c191252d33090dbb88b98735148 (diff) |
Refactor Remote Event (#1396)
Diffstat (limited to 'Firestore/Example/Tests/SpecTests/FSTSpecTests.mm')
-rw-r--r-- | Firestore/Example/Tests/SpecTests/FSTSpecTests.mm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Firestore/Example/Tests/SpecTests/FSTSpecTests.mm b/Firestore/Example/Tests/SpecTests/FSTSpecTests.mm index 77010e5..c131f7e 100644 --- a/Firestore/Example/Tests/SpecTests/FSTSpecTests.mm +++ b/Firestore/Example/Tests/SpecTests/FSTSpecTests.mm @@ -256,12 +256,15 @@ static NSString *const kNoIOSTag = @"no-ios"; } else if (watchEntity[@"doc"]) { NSArray *docSpec = watchEntity[@"doc"]; FSTDocumentKey *key = FSTTestDocKey(docSpec[0]); - FSTObjectValue *value = FSTTestObjectValue(docSpec[2]); + FSTObjectValue *_Nullable value = + [docSpec[2] isKindOfClass:[NSNull class]] ? nil : FSTTestObjectValue(docSpec[2]); SnapshotVersion version = [self parseVersion:docSpec[1]]; - FSTMaybeDocument *doc = [FSTDocument documentWithData:value - key:key - version:std::move(version) - hasLocalMutations:NO]; + FSTMaybeDocument *doc = + value ? [FSTDocument documentWithData:value + key:key + version:std::move(version) + hasLocalMutations:NO] + : [FSTDeletedDocument documentWithKey:key version:std::move(version)]; FSTWatchChange *change = [[FSTDocumentWatchChange alloc] initWithUpdatedTargetIDs:watchEntity[@"targets"] removedTargetIDs:watchEntity[@"removedTargets"] |