Skip to content

Check if raw is a null pointer for findObject#173

Merged
evanphx merged 1 commit intoevanphx:masterfrom
JosieLi-Google:master
Sep 11, 2023
Merged

Check if raw is a null pointer for findObject#173
evanphx merged 1 commit intoevanphx:masterfrom
JosieLi-Google:master

Conversation

@JosieLi-Google
Copy link
Contributor

No description provided.

@yliaog
Copy link

yliaog commented Apr 4, 2023

/assign @evanphx

@yliaog
Copy link

yliaog commented Apr 4, 2023

@evanphx could you help review the PR? thanks.


next, ok := doc.get(decodePatchKey(part))

if next == nil || ok != nil {

Choose a reason for hiding this comment

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

My guess is that it would be better to correct this variable name from ok to err, and fix https://github.com/evanphx/json-patch/blob/master/patch.go#L395 to return an error if the key doesn't exist.

A test case demonstrating how to produce this condition would be good?

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.

4 participants