Skip to content

Prevent NPE#8046

Merged
junichi11 merged 1 commit intoapache:masterfrom
junichi11:php-fix-npe
Dec 13, 2024
Merged

Prevent NPE#8046
junichi11 merged 1 commit intoapache:masterfrom
junichi11:php-fix-npe

Conversation

@junichi11
Copy link
Copy Markdown
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
@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