Skip to content

Commit

Permalink
Fix potential nil dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennor committed Sep 20, 2021
1 parent 4e07cf3 commit 06e4526
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/router/dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ func (d Dispatch) FieldResolve(rs ResolverConfig) func(params graphql.ResolvePar
return nil, nil
}
}
isSubscription := params.Info.Path.Prev == nil &&
isSubscription := params.Info.Path != nil &&
params.Info.Path.Prev == nil &&
params.Info.Schema.SubscriptionType().Name() == params.Info.ParentType.Name()
if isSubscription {
params.Source = params.Context.Value(SubscriptionPayloadKey)
Expand Down

0 comments on commit 06e4526

Please sign in to comment.