Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: nil pointer panic #19

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions store.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,6 @@ func (c *StoreClient) GetSubscriptionRenewalDataStatus(ctx context.Context, prod
// GetNotificationHistory https://developer.apple.com/documentation/appstoreserverapi/get_notification_history
func (c *StoreClient) GetNotificationHistory(ctx context.Context, body NotificationHistoryRequest) (responses []NotificationHistoryResponseItem, err error) {
baseURL := c.hostUrl + PathGetNotificationHistory

bodyBuf := new(bytes.Buffer)
err = json.NewEncoder(bodyBuf).Encode(body)
if err != nil {
return nil, err
}

URL := baseURL

for {
Expand All @@ -357,8 +350,8 @@ func (c *StoreClient) GetNotificationHistory(ctx context.Context, body Notificat
rsp := NotificationHistoryResponses{}
rsp.NotificationHistory = make([]NotificationHistoryResponseItem, 0)

client = SetRequestBodyJSON(client, body)
client = SetRequest(ctx, client, http.MethodPost, URL)
client = SetRequestBodyJSON(client, bodyBuf)
client = SetResponseBodyHandler(client, json.Unmarshal, &rsp)
_, err = client.Do(nil)
if apiErr.errorCode != 0 {
Expand Down
Loading