File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/main/com/intellij/lang/jsgraphql/types/schema/idl/errors Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ The MIT License (MIT)
3232@ SuppressWarnings ("rawtypes" )
3333@ Internal
3434public class BaseError extends GraphQLException implements GraphQLError {
35- protected static final SourceLocation NO_WHERE = new SourceLocation (-1 , -1 );
35+ protected static final SourceLocation EMPTY = new SourceLocation (-1 , -1 );
3636
3737 private final Node node ;
3838 private final List <Node > myReferences = new ArrayList <>();
@@ -43,13 +43,15 @@ public BaseError(@Nullable Node node, @Nullable String msg) {
4343 }
4444
4545 public static String lineCol (Node node ) {
46- SourceLocation sourceLocation = node .getSourceLocation () == null ? NO_WHERE : node .getSourceLocation ();
46+ SourceLocation sourceLocation = node .getSourceLocation () == null ? EMPTY : node .getSourceLocation ();
4747 return String .format ("[@%d:%d]" , sourceLocation .getLine (), sourceLocation .getColumn ());
4848 }
4949
5050 @ Override
5151 public List <SourceLocation > getLocations () {
52- return node == null ? Collections .singletonList (NO_WHERE ) : Collections .singletonList (node .getSourceLocation ());
52+ return node == null || node .getSourceLocation () == null ?
53+ Collections .singletonList (EMPTY ) :
54+ Collections .singletonList (node .getSourceLocation ());
5355 }
5456
5557 @ Override
You can’t perform that action at this time.
0 commit comments