Skip to content

Commit

Permalink
Handle duplicate protobuf descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Oct 20, 2023
1 parent 13d02a6 commit f29b9d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/shared/log/ProtoDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ export default class ProtoDecoder {

/** Registers a new descriptor. */
addDescriptor(data: Uint8Array): void {
this.rawDescriptors.push(data);
let fileDescriptor: any = descriptor.FileDescriptorProto.decode(data);
if (this.root.files.includes(fileDescriptor.name)) return; // Duplicate filename
this.rawDescriptors.push(data);
let filePackage: any = this.root;
if (fileDescriptor.package && fileDescriptor.package.length > 0) {
filePackage = this.root.define(fileDescriptor.package);
Expand Down

0 comments on commit f29b9d4

Please sign in to comment.