Skip to content

Commit

Permalink
rules: adds missing nil checking
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-ramon committed Aug 5, 2017
1 parent 9216e93 commit 24b3245
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rules_overlapping_fields_can_be_merged.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,10 @@ func (rule *overlappingFieldsCanBeMergedRule) getFieldsAndFragmentNames(parentTy
fieldName = selection.Name.Value
}
var fieldDef *FieldDefinition
if parentType, ok := parentType.(*Object); ok {
if parentType, ok := parentType.(*Object); ok && parentType != nil {
fieldDef, _ = parentType.Fields()[fieldName]
}
if parentType, ok := parentType.(*Interface); ok {
if parentType, ok := parentType.(*Interface); ok && parentType != nil {
fieldDef, _ = parentType.Fields()[fieldName]
}

Expand Down

0 comments on commit 24b3245

Please sign in to comment.