This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-ide-tooling.git


The following commit(s) were added to refs/heads/master by this push:
     new 6b8d4f15 SLING-13254 Prevent possible NPE during 
IConsoleListener.consolesAdded()
6b8d4f15 is described below

commit 6b8d4f151cb33b3f800c47b1ba99aecb01d06d3a
Author: Konrad Windszus <[email protected]>
AuthorDate: Sun Jul 5 17:22:07 2026 +0200

    SLING-13254 Prevent possible NPE during IConsoleListener.consolesAdded()
    
    As the type may return null don't dereference it unconditionally.
---
 .../sling/ide/eclipse/ui/internal/console/SlingConsoleLogger.java      | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/eclipse/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/console/SlingConsoleLogger.java
 
b/eclipse/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/console/SlingConsoleLogger.java
index 62adb9cf..85f464ca 100644
--- 
a/eclipse/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/console/SlingConsoleLogger.java
+++ 
b/eclipse/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/console/SlingConsoleLogger.java
@@ -18,7 +18,6 @@ package org.apache.sling.ide.eclipse.ui.internal.console;
 
 import java.io.IOException;
 import java.io.PrintStream;
-import java.time.Instant;
 import java.time.LocalTime;
 import java.time.format.DateTimeFormatter;
 
@@ -65,7 +64,7 @@ public class SlingConsoleLogger implements LogSubscriber {
                        public void consolesAdded(IConsole[] consoles) {
                                synchronized (sync) {
                                        for (IConsole console : consoles) {
-                                               if 
(console.getType().equals(SlingConsoleFactory.CONSOLE_TYPE_SLING)) {
+                                               if 
(SlingConsoleFactory.CONSOLE_TYPE_SLING.equals(console.getType())) {
                                                        slingConsole = 
(MessageConsole) console;
                                                        break;
                                                }

Reply via email to