Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent NPE #8046

Merged
merged 1 commit into from
Dec 13, 2024
Merged

Prevent NPE #8046

merged 1 commit into from
Dec 13, 2024

Conversation

junichi11
Copy link
Member

@@ -155,7 +146,7 @@ List<OffsetRange> processImpl(ParserResult info, Document doc, int caretPosition
 
         Map<OffsetRange, ColoringAttributes> highlights = finder.getOccurrences();
 
-        return highlights == null ? null : new ArrayList<OffsetRange>(highlights.keySet());
+        return List.copyOf(highlights.keySet());

- Do not return `null` in `getOccurrences()`
- See apacheGH-8028
@junichi11 junichi11 added the PHP [ci] enable extra PHP tests (php/php.editor) label Dec 13, 2024
@junichi11 junichi11 added this to the NB25 milestone Dec 13, 2024
@junichi11 junichi11 requested a review from tmysik December 13, 2024 05:40
@junichi11 junichi11 merged commit f00c1a4 into apache:master Dec 13, 2024
32 checks passed
@junichi11 junichi11 deleted the php-fix-npe branch December 13, 2024 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants