Skip to content

Commit 0aac0af

Browse files
authored
Merge pull request #19 from wao3/patch-1
fix: nil pointer panic
2 parents f9393bd + d86b73e commit 0aac0af

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

store.go

+1-8
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,6 @@ func (c *StoreClient) GetSubscriptionRenewalDataStatus(ctx context.Context, prod
338338
// GetNotificationHistory https://developer.apple.com/documentation/appstoreserverapi/get_notification_history
339339
func (c *StoreClient) GetNotificationHistory(ctx context.Context, body NotificationHistoryRequest) (responses []NotificationHistoryResponseItem, err error) {
340340
baseURL := c.hostUrl + PathGetNotificationHistory
341-
342-
bodyBuf := new(bytes.Buffer)
343-
err = json.NewEncoder(bodyBuf).Encode(body)
344-
if err != nil {
345-
return nil, err
346-
}
347-
348341
URL := baseURL
349342

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

353+
client = SetRequestBodyJSON(client, body)
360354
client = SetRequest(ctx, client, http.MethodPost, URL)
361-
client = SetRequestBodyJSON(client, bodyBuf)
362355
client = SetResponseBodyHandler(client, json.Unmarshal, &rsp)
363356
_, err = client.Do(nil)
364357
if apiErr.errorCode != 0 {

0 commit comments

Comments
 (0)