Skip to content

Check if raw is a null pointer for findObject - #173

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

evanphx merged 1 commit into
evanphx:masterfrom
JosieLi-Google:master

Conversation

@JosieLi-Google

Copy link
Copy Markdown
Contributor

No description provided.

@yliaog

yliaog commented Apr 4, 2023

Copy link
Copy Markdown

/assign @evanphx

@yliaog

yliaog commented Apr 4, 2023

Copy link
Copy Markdown

@evanphx could you help review the PR? thanks.

Comment thread patch.go

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

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

Copy link
Copy Markdown

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