Skip to content

fix: prevent Write(nil) from panicking #1

Description

@masonkatz

Table.Write(nil) panics because reflect.TypeOf(nil) is nil and the implementation immediately calls Kind() on it. This contradicts Write behavior for other non-struct inputs, which are represented as an error row.

Acceptance criteria

  1. Add a regression test that calls Write(nil) and demonstrates the intended non-panicking error-row behavior.
  2. Update Write to handle a nil argument before accessing reflection type metadata.
  3. Ensure nil uses the same observable error-table/annotation behavior as other non-struct values.
  4. Run the relevant test suite.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions