Skip to content

google.protobuf.Value unwrap method returns enum value instead of null #1202

@errorhandler

Description

@errorhandler

The generated unwrap method for google.protobuf.Value has incorrect behavior for null values:

unwrap(message: Value): string | number | boolean | Object | null | Array<any> | undefined {
  return message.kind?.value;
}

Issue: When the protobuf value is null, the method returns 0 (the enum value) instead of null as indicated by the return type signature.

Impact: Cannot distinguish between a numeric 0 and null value.

Expected: Method should return null for null protobuf values, not the underlying enum value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions