Skip to content
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

Panic on Apply of op:test with non existing attribute #114

Closed
kolomnik opened this issue Sep 21, 2020 · 1 comment
Closed

Panic on Apply of op:test with non existing attribute #114

kolomnik opened this issue Sep 21, 2020 · 1 comment

Comments

@kolomnik
Copy link

Hello,

I have tried to apply following patch:

[{"op":"test","path":"/missingAttr"}]

on json:

{"intAttr":10,"strAttr":"string"}

And it resulted in panic:
runtime error: invalid memory address or nil pointer dereference:

With stack:
/usr/local/go/src/runtime/panic.go:679
runtime.panicmem
/usr/local/go/src/runtime/panic.go:199
runtime.sigpanic
/usr/local/go/src/runtime/signal_unix.go:394
github.com/evanphx/json-patch.newLazyNode
.../go/pkg/mod/github.com/evanphx/json-patch@v4.9.0+incompatible/patch.go:61
github.com/evanphx/json-patch.Patch.ApplyIndent
.../go/pkg/mod/github.com/evanphx/json-patch@v4.9.0+incompatible/patch.go:752
github.com/evanphx/json-patch.Patch.Apply
.../go/pkg/mod/github.com/evanphx/json-patch@v4.9.0+incompatible/patch.go:718
cm-backend/server/api.processJsonPatch
....

Expectation was to see an error.

@danmx
Copy link

danmx commented Oct 28, 2023

it seems it's fixed an can be closed

@evanphx evanphx closed this as completed Jan 12, 2024
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

No branches or pull requests

3 participants