From 700413cb64bd9a6a9c57b862106195f39decb045 Mon Sep 17 00:00:00 2001 From: zxu Date: Tue, 24 Apr 2018 12:41:49 -0400 Subject: fix a bug caught by asan failure (#1173) --- Firestore/core/src/firebase/firestore/model/field_value.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Firestore/core/src/firebase/firestore/model') diff --git a/Firestore/core/src/firebase/firestore/model/field_value.cc b/Firestore/core/src/firebase/firestore/model/field_value.cc index 9b3acad..35253c8 100644 --- a/Firestore/core/src/firebase/firestore/model/field_value.cc +++ b/Firestore/core/src/firebase/firestore/model/field_value.cc @@ -183,12 +183,12 @@ FieldValue FieldValue::Set(const FieldPath& field_path, } else { ObjectValue::Map copy = CopyExcept(object_map, child_name); const auto iter = object_map.find(child_name); - if (iter == copy.end() || iter->second.type() != Type::Object) { + if (iter == object_map.end() || iter->second.type() != Type::Object) { copy[child_name] = FieldValue::ObjectValueFromMap({}).Set( field_path.PopFirst(), std::move(value)); } else { - copy[child_name] = object_map.at(child_name) - .Set(field_path.PopFirst(), std::move(value)); + copy[child_name] = + iter->second.Set(field_path.PopFirst(), std::move(value)); } return FieldValue::ObjectValueFromMap(std::move(copy)); } -- cgit v1.2.3