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 {
52
52
// from the object.
53
53
const ::google::protobuf::Message *message =
54
54
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
+ }
61
62
}
62
63
63
64
// 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