Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

[Fix] Nil pointer exception on empty description #189

Merged
merged 2 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Fixed Bugs

- [PR #167](https://github.com/Orange-OpenSource/nifikop/pull/167) - **[Operator/NiFiDataflow]** Fix nil pointer exception case whe sync Dataflow.
- [PR #189](https://github.com/Orange-OpenSource/nifikop/pull/189) - **[Operator/NiFiParameterContext]** Fix nil pointer exception case on empty description.

## v0.7.5

Expand Down
8 changes: 6 additions & 2 deletions pkg/clientwrappers/parametercontext/parametercontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ func parameterContextIsSync(
!((expected.Parameter.Value == nil && param.Parameter.Value == nil) ||
((expected.Parameter.Value != nil && param.Parameter.Value != nil) &&
(*expected.Parameter.Value == *param.Parameter.Value)))) ||
*expected.Parameter.Description != *param.Parameter.Description {
!((expected.Parameter.Description == nil || *expected.Parameter.Description == "") &&
((param.Parameter.Description == nil || *param.Parameter.Description == "") ||
(expected.Parameter.Description == param.Parameter.Description))) {

return false
}
Expand Down Expand Up @@ -203,7 +205,9 @@ func updateRequestPrepare(
!((expected.Parameter.Value == nil && param.Parameter.Value == nil) ||
((expected.Parameter.Value != nil && param.Parameter.Value != nil) &&
(*expected.Parameter.Value == *param.Parameter.Value)))) ||
*expected.Parameter.Description != *param.Parameter.Description {
!((expected.Parameter.Description == nil || *expected.Parameter.Description == "") &&
((param.Parameter.Description == nil || *param.Parameter.Description == "") ||
(expected.Parameter.Description == param.Parameter.Description))) {
notFound = false
if expected.Parameter.Value == nil && param.Parameter.Value != nil {
toRemove = append(toRemove, expected.Parameter.Name)
Expand Down