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:
- Use the GetTrackings request.
- Receive a response where Pagination is missing or empty.
- 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.