aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/map_field_inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/map_field_inl.h')
-rw-r--r--src/google/protobuf/map_field_inl.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/google/protobuf/map_field_inl.h b/src/google/protobuf/map_field_inl.h
index 1a4ce937..16c4a08f 100644
--- a/src/google/protobuf/map_field_inl.h
+++ b/src/google/protobuf/map_field_inl.h
@@ -153,7 +153,9 @@ void TypeDefinedMapFieldBase<Key, T>::CopyIterator(
const MapIterator& that_iter) const {
InternalGetIterator(this_iter) = InternalGetIterator(&that_iter);
this_iter->key_.SetType(that_iter.key_.type());
- this_iter->value_.SetType(that_iter.value_.type());
+ // MapValueRef::type() fails when containing data is null. However, if
+ // this_iter points to MapEnd, data can be null.
+ this_iter->value_.SetType((FieldDescriptor::CppType)that_iter.value_.type_);
SetMapIteratorValue(this_iter);
}