Skip to content

Commit

Permalink
Merge pull request #8071 from junichi11/js-fix-npe
Browse files Browse the repository at this point in the history
Prevent NPE
  • Loading branch information
junichi11 authored Dec 18, 2024
2 parents 70f6941 + 2a5566f commit 22172a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public void setCaretPosition(int position) {

@Override
public Map<OffsetRange, ColoringAttributes> getOccurrences() {
return range2Attribs;
return range2Attribs != null
? Collections.unmodifiableMap(range2Attribs)
: Collections.emptyMap();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public void setCaretPosition(int position) {

@Override
public Map<OffsetRange, ColoringAttributes> getOccurrences() {
return range2Attribs;
return range2Attribs != null
? Collections.unmodifiableMap(range2Attribs)
: Collections.emptyMap();
}

@Override
Expand Down

0 comments on commit 22172a9

Please sign in to comment.