Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.
/ gobolt Public archive

handle panic in (*ptr)nil cases #1

Merged
merged 1 commit into from
Nov 19, 2018
Merged

handle panic in (*ptr)nil cases #1

merged 1 commit into from
Nov 19, 2018

Conversation

adamglt
Copy link
Contributor

@adamglt adamglt commented Nov 11, 2018

Value translation panics for nil interface{}.
Similar to what's described here: https://golang.org/doc/faq#nil_error

For example, with this combo:

var niltime *time.Time
params := M{"props": M{"name": "hello", "bla1": niltime}}
q := `
CREATE (b: Bla $props)
RETURN properties(b)
`

You get a panic: reflect: call of reflect.Value.Interface on zero Value.

This is a pretty common case when mapping from domain structs to map[string]interface{}.

@ali-ince
Copy link
Contributor

Hi @adamglt, thanks for submitting this PR. To be able to merge your changes we will need a signed CLA from you. See http://neo4j.com/developer/cla/ for further information. Additional information on contributing code is found at http://neo4j.com/developer/contributing-code/.

Thanks.

@ali-ince ali-ince changed the base branch from 1.7 to 1.7-dev November 16, 2018 14:22
@adamglt
Copy link
Contributor Author

adamglt commented Nov 16, 2018

Sent, thanks.

@ali-ince ali-ince merged commit 9b8cd37 into neo4j-drivers:1.7-dev Nov 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants