ts-proto 2.2.4 → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -188,8 +188,8 @@ function encodedOptionsToOptions(ctx, extendee, encodedOptions) {
188
188
  const resultOptions = [];
189
189
  for (const key in encodedOptions) {
190
190
  const value = encodedOptions[key];
191
- const extension = extensionCache[extendee][parseInt(key, 10) >>> 3];
192
- if (shouldAddOptionDefinition(ctx, extension)) {
191
+ const extension = extensionCache[extendee]?.[parseInt(key, 10) >>> 3];
192
+ if (extension && shouldAddOptionDefinition(ctx, extension)) {
193
193
  // todo: we should be able to create an option definition ALWAYS, however,
194
194
  // we currently cannot do that because the if the extension is a sub-message
195
195
  // (and thus, not just a straightforward value), we don't have an JSON object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-proto",
3
- "version": "2.2.4",
3
+ "version": "2.2.5",
4
4
  "description": "",
5
5
  "main": "build/src/plugin.js",
6
6
  "repository": "github:stephenh/ts-proto",