Hey folks, we discovered that we get a panic if we apply the following operations to a JSON: * op: replace, path: "/spec/template/spec/kubeadmConfigSpec/preKubeadmCommands", value: nil * op: add, path: "/spec/template/spec/kubeadmConfigSpec/preKubeadmCommands/0", value: "some text" The panic occurs here: https://github.com/evanphx/json-patch/blob/master/v5/patch.go#L509-L513 I think the problem is that it is only checked if `next` is `nil`, but not `next.raw`. So then it panics in l.513 at `*next.raw`.
Activity
Handle null correctly when introduced by replace. Fixes #171
Merge pull request #196 from evanphx/b-null-mistype-panic
sbueringer commentedon Jan 12, 2024
Thank you very much!!