Skip to content

Commit

Permalink
Update pointer.go
Browse files Browse the repository at this point in the history
  • Loading branch information
aacebo committed Dec 2, 2024
1 parent 0a90aa2 commit e74f7c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gq/pointer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (self Pointer) Key() string {
func (self Pointer) Do(params *DoParams) Result {
value := reflect.ValueOf(params.Value)

if value.Kind() == reflect.Pointer {
if value.IsValid() && value.Kind() == reflect.Pointer {
value = value.Elem()
params.Value = value.Interface()
}
Expand All @@ -37,7 +37,7 @@ func (self Pointer) Do(params *DoParams) Result {
func (self Pointer) Resolve(params *ResolveParams) Result {
value := reflect.ValueOf(params.Value)

if value.Kind() == reflect.Pointer {
if value.IsValid() && value.Kind() == reflect.Pointer {
value = value.Elem()
params.Value = value.Interface()
}
Expand Down

0 comments on commit e74f7c6

Please sign in to comment.