Skip to content

fix(iaas): safely check resp.NetworkInterface for nil#1497

Merged
cgoetz-inovex merged 1 commit into
mainfrom
fix/nil-ptr-GetPublicIP
Jul 23, 2026
Merged

fix(iaas): safely check resp.NetworkInterface for nil#1497
cgoetz-inovex merged 1 commit into
mainfrom
fix/nil-ptr-GetPublicIP

Conversation

@cgoetz-inovex

Copy link
Copy Markdown
Contributor

NullableString.IsSet() returns true even if the value is nil:

func (v *NullableString) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}

Description

relates to #1234

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see e.g. here)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

NullableString.IsSet() returns true even if the value is nil:

```
func (v *NullableString) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}
```
@cgoetz-inovex
cgoetz-inovex requested a review from a team as a code owner July 23, 2026 12:54
@github-actions

Copy link
Copy Markdown

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/stackit-cli/internal/pkg/services/iaas/utils 85.45% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/stackit-cli/internal/pkg/services/iaas/utils/utils.go 85.45% (ø) 110 94 16

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/stackitcloud/stackit-cli/internal/pkg/services/iaas/utils/utils_test.go

@cgoetz-inovex
cgoetz-inovex merged commit 83ecfca into main Jul 23, 2026
3 checks passed
@cgoetz-inovex
cgoetz-inovex deleted the fix/nil-ptr-GetPublicIP branch July 23, 2026 12:57
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