Skip to content

Conversation

@xHozey
Copy link
Contributor

@xHozey xHozey commented Feb 7, 2026

What does this PR do?

Initializes options.Config in ContainerCreate when it is nil to prevent a nil pointer dereference.

Why is it important?

Calling ContainerCreate with a nil Config previously caused a panic when dereferencing the value.
This change ensures the SDK behaves safely when optional fields are not provided.

Related issues

N/A

How to test this PR

  • Call ContainerCreate without setting options.Config and verify it does not panic

Copilot AI review requested due to automatic review settings February 7, 2026 21:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Prevents a nil-pointer panic in the SDK client’s ContainerCreate wrapper by ensuring options.Config is initialized before use, improving safety when callers omit optional fields.

Changes:

  • Initialize options.Config to a zero-value container.Config when it is nil in ContainerCreate.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mdelapenya mdelapenya self-assigned this Feb 9, 2026
@mdelapenya mdelapenya added the bug Something isn't working label Feb 9, 2026
Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mdelapenya mdelapenya merged commit 791b0b0 into docker:main Feb 9, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants