Skip to content

fix: nil-check Input in Clone() for following/preceding queries - #132

Open
AruneshDwivedi wants to merge 1 commit into
antchfx:masterfrom
AruneshDwivedi:fix/nil-input-clone
Open

fix: nil-check Input in Clone() for following/preceding queries#132
AruneshDwivedi wants to merge 1 commit into
antchfx:masterfrom
AruneshDwivedi:fix/nil-input-clone

Conversation

@AruneshDwivedi

Copy link
Copy Markdown
Contributor

followingQuery.Clone() and precedingQuery.Clone() called f.Input.Clone() without checking if Input was nil, causing a panic when the query had no input (e.g. concat("a","f")). Added nil checks to both Clone() methods.

Fixes #131

concat("a","f") produced a query with nil Input, and Clone() called
f.Input.Clone() without checking, causing a nil pointer dereference.
Add nil checks so Clone() returns a shallow copy when Input is nil.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 82.031% (-0.1%) from 82.14% — AruneshDwivedi:fix/nil-input-clone into antchfx:master

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.

2 participants