Skip to content

Commit

Permalink
Prevent NPE
Browse files Browse the repository at this point in the history
- Add `null` check because it may be `null` when the mark occurrences feature is canceled
  • Loading branch information
junichi11 committed Dec 18, 2024
1 parent c91a741 commit 94c111a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public void setCaretPosition(int position) {
@Override
public Map<OffsetRange, ColoringAttributes> getOccurrences() {
// must not return null
return Collections.unmodifiableMap(range2Attribs);
return range2Attribs != null
? Collections.unmodifiableMap(range2Attribs)
: Collections.emptyMap();
}

@Override
Expand Down

0 comments on commit 94c111a

Please sign in to comment.