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 map assignment error #9

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

bluewolfali
Copy link
Contributor

In the GetFriendshipStatusCall.Do method, there is a bug that causes a runtime panic with the error message "assignment to entry in nil map". This error occurs when trying to set a value in the urlQuery map, which has been declared but not initialized.

Here is the problematic code:

func (call *GetFriendshipStatusCall) Do() (*GetFriendshipStatusResponse, error) {
	var urlQuery url.Values
	urlQuery.Set("access_token", call.accessToken)
	...
}

Copy link
Owner

@kkdai kkdai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kkdai kkdai merged commit e9ca982 into kkdai:master Mar 25, 2024
1 check passed
@bluewolfali bluewolfali deleted the fix-nil-map-assignment_#1 branch March 25, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants