From 4c7057e45ba8a2f3bc1f0b02b3edf14886fd1956 Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Tue, 04 Aug 2026 08:31:56 +0000
Subject: [PATCH] Fix CodeQL note-severity alerts: uncaught NumberFormatException in the tools, the GUI and SNMP (#829)

---
 opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/UIFactory.java |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/UIFactory.java b/opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/UIFactory.java
index 2f4791c..6865d9a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/UIFactory.java
+++ b/opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/UIFactory.java
@@ -1165,11 +1165,19 @@
   {
     String s = String.valueOf(l);
     String[] colors = s.split(",");
-    int r = Integer.parseInt(colors[0].trim());
-    int g = Integer.parseInt(colors[1].trim());
-    int b = Integer.parseInt(colors[2].trim());
+    try
+    {
+      int r = Integer.parseInt(colors[0].trim());
+      int g = Integer.parseInt(colors[1].trim());
+      int b = Integer.parseInt(colors[2].trim());
 
-    return new Color(r, g, b);
+      return new Color(r, g, b);
+    }
+    catch (NumberFormatException | IndexOutOfBoundsException e)
+    {
+      logger.warn(LocalizableMessage.raw("Invalid color definition \"%s\", using black instead", s));
+      return Color.BLACK;
+    }
   }
 
   /**

--
Gitblit v1.10.0