Skip to content

Commit 33a355d

Browse files
committed
Null check for org.eclipse.help.IContext
Check whether context is null or not before invoking getText() Fixes : #1689
1 parent c7ebd24 commit 33a355d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ua/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DefaultHelpUI.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/***************************************************************************************************
2-
* Copyright (c) 2000, 2020 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -18,6 +18,7 @@
1818
import java.net.URL;
1919
import java.net.URLEncoder;
2020
import java.nio.charset.StandardCharsets;
21+
import java.util.Objects;
2122

2223
import org.eclipse.core.runtime.ILog;
2324
import org.eclipse.core.runtime.Platform;
@@ -333,6 +334,7 @@ void displayContext(IContext context, int x, int y, boolean noInfopop) {
333334
* If the context help has no description text and exactly one
334335
* topic, go straight to the topic and skip context help.
335336
*/
337+
Objects.requireNonNull(context, "context must not be null when displaying help content"); //$NON-NLS-1$
336338
String contextText = context.getText();
337339
IHelpResource[] topics = context.getRelatedTopics();
338340
boolean isSingleChoiceWithoutDescription = contextText == null && topics.length == 1;

0 commit comments

Comments
 (0)