Skip to content

Commit 146621b

Browse files
committed
Filter Error positions where locations do not exist.
Fixes #507
1 parent f379d69 commit 146621b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/error/GraphQLError.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export function GraphQLError( // eslint-disable-line no-redeclare
103103

104104
let _positions = positions;
105105
if (!_positions && nodes) {
106-
_positions = nodes.filter(node => node.loc !== null)
106+
_positions = nodes.filter(node => Boolean(node.loc))
107107
.map(node => node.loc.start);
108108
}
109109
if (_positions && _positions.length === 0) {

0 commit comments

Comments
 (0)