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)
32
32
@ SuppressWarnings ("rawtypes" )
33
33
@ Internal
34
34
public 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 );
36
36
37
37
private final Node node ;
38
38
private final List <Node > myReferences = new ArrayList <>();
@@ -43,13 +43,15 @@ public BaseError(@Nullable Node node, @Nullable String msg) {
43
43
}
44
44
45
45
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 ();
47
47
return String .format ("[@%d:%d]" , sourceLocation .getLine (), sourceLocation .getColumn ());
48
48
}
49
49
50
50
@ Override
51
51
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 ());
53
55
}
54
56
55
57
@ Override
You can’t perform that action at this time.
0 commit comments