Skip to content

fix: Fix error "assignment to entry in nil map" of Files.Upload() #235

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

Merged
merged 2 commits into from
Apr 14, 2025

Conversation

meinside
Copy link
Contributor

@meinside meinside commented Apr 9, 2025

This patch fixes the error "assignment to entry in nil map" of Files.Upload() when config.HTTPOptions is nil.

Current code is nil-checking config.HTTPOptions.Headers, not httpOptions.

Also, config is not used afterward, so setting config.HTTPOptions.Headers to an empty http.Header is not needed.

Copy link

google-cla bot commented Apr 9, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

…hen `config.HTTPOptions` is nil

Current code is nil-checking `config.HTTPOptions.Headers`, not `httpOptions`.

Also, `config` is not used afterward, so setting `config.HTTPOptions.Headers` to an empty `http.Header` is not needed.
@qiaodev qiaodev self-requested a review April 14, 2025 17:26
@qiaodev qiaodev merged commit 05c0c49 into googleapis:main Apr 14, 2025
8 checks passed
@qiaodev
Copy link
Collaborator

qiaodev commented Apr 14, 2025

Thanks for fixing the bug!

copybara-service bot pushed a commit that referenced this pull request Apr 14, 2025
…247

FUTURE_COPYBARA_INTEGRATE_REVIEW=#235 from meinside:patch-1 23a0ab2
PiperOrigin-RevId: 747516170
copybara-service bot pushed a commit that referenced this pull request Apr 14, 2025
FUTURE_COPYBARA_INTEGRATE_REVIEW=#235 from meinside:patch-1 23a0ab2
PiperOrigin-RevId: 745674145
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