Skip to content

Bug Report: panic in GetTrackings when Pagination is nil #14

@xmatzx

Description

@xmatzx

Library version:
github.com/AfterShip/tracking-sdk-go v9.0.0

Issue:
When calling GetTrackings, the SDK panics if the API response does not include a Pagination object.

In get_trackings.go, inside the Execute method, Pagination is accessed directly without checking if it is nil, which results in:
panic: runtime error: invalid memory address or nil pointer dereference

Steps to Reproduce:

  1. Use the GetTrackings request.
  2. Receive a response where Pagination is missing or empty.
  3. Observe that the SDK crashes with a panic.

Expected Behavior:
The SDK should handle cases where Pagination is nil gracefully (e.g., return nil or a default Pagination object) instead of panicking.

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