You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2026/07/05 15:22:16 UTC

(sling-ide-tooling) branch bugfix/prevent-npe-in-slingconsolelogger created (now 8a8f1375)

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

kwin pushed a change to branch bugfix/prevent-npe-in-slingconsolelogger
in repository https://gitbox.apache.org/repos/asf/sling-ide-tooling.git


      at 8a8f1375 SLING-13254 Prevent possible NPE during IConsoleListener.consolesAdded()

This branch includes the following new commits:

     new 8a8f1375 SLING-13254 Prevent possible NPE during IConsoleListener.consolesAdded()

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(sling-ide-tooling) 01/01: SLING-13254 Prevent possible NPE during IConsoleListener.consolesAdded()

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8a8f13758d79ed988f992126ad91d723acf27f52
Author: Konrad Windszus <kw...@apache.org>
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;
 						}