Skip to content

Commit b55a85f

Browse files
Fix server timestamp
1 parent 97c2a9c commit b55a85f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

firestore/src/main/document_snapshot_main.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ FieldValue DocumentSnapshotInternal::ConvertAnyValue(
9595
const google_firestore_v1_Value& input, ServerTimestampBehavior stb) const {
9696
switch (input.which_value_type) {
9797
case google_firestore_v1_Value_map_value_tag:
98+
if (IsServerTimestamp(input)) {
99+
return ConvertServerTimestamp(input, stb);
100+
}
98101
return ConvertObject(input.map_value, stb);
99102
case google_firestore_v1_Value_array_value_tag:
100103
return ConvertArray(input.array_value, stb);
@@ -131,10 +134,7 @@ FieldValue DocumentSnapshotInternal::ConvertScalar(
131134
const google_firestore_v1_Value& scalar,
132135
ServerTimestampBehavior stb) const {
133136
switch (scalar.which_value_type) {
134-
case google_firestore_v1_Value_map_value_tag:
135-
if (IsServerTimestamp(scalar)) {
136-
return ConvertServerTimestamp(scalar, stb);
137-
}
137+
case google_firestore_v1_Value_null_value_tag:
138138
return FieldValue::Null();
139139
case google_firestore_v1_Value_boolean_value_tag:
140140
return FieldValue::Boolean(scalar.boolean_value);

0 commit comments

Comments
 (0)