Skip to content

Commit

Permalink
fix: request.compiler_version is undefined (#140)
Browse files Browse the repository at this point in the history
When running with buf, request.compiler_version is undefined, which
causes a TypeError when attempting to assign major, minor and patch.

Fixes #139.
  • Loading branch information
gcurtis authored May 13, 2022
1 parent d665bfe commit 46aac75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ for (const fileDescriptor of request.proto_file) {
}
}

const { major = 0, minor = 0, patch = 0 } = request.compiler_version;
const { major = 0, minor = 0, patch = 0 } = request.compiler_version ?? {};

const comments = [
`Generated by the protoc-gen-ts. DO NOT EDIT!`,
Expand Down

0 comments on commit 46aac75

Please sign in to comment.