File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -52,12 +52,13 @@ struct proto_caster_load_impl {
5252 // from the object.
5353 const ::google::protobuf::Message *message =
5454 pybind11_protobuf::PyProtoGetCppMessagePointer (src);
55- if (message && message->GetReflection () ==
56- ProtoType::default_instance ().GetReflection ()) {
57- // If the capability were available, then we could probe PyProto_API and
58- // allow c++ mutability based on the python reference count.
59- value = static_cast <const ProtoType *>(message);
60- return true ;
55+ if (message) {
56+ value = dynamic_cast <const ProtoType *>(message);
57+ if (value) {
58+ // If the capability were available, then we could probe PyProto_API and
59+ // allow c++ mutability based on the python reference count.
60+ return true ;
61+ }
6162 }
6263
6364 // The incoming object is not a compatible fast_cpp_proto, so check whether
You can’t perform that action at this time.
0 commit comments