From: Mathieu Baudier Date: Tue, 5 Mar 2024 15:16:46 +0000 (+0100) Subject: Make Gogo shell killer more robust X-Git-Tag: v2.3.28~31 X-Git-Url: https://git.argeo.org/?p=lgpl%2Fargeo-commons.git;a=commitdiff_plain;h=a9b4ba6cd79a32b092e24ebfa907ecf90f0cf938 Make Gogo shell killer more robust --- diff --git a/org.argeo.cms/src/org/argeo/cms/internal/osgi/GogoShellKiller.java b/org.argeo.cms/src/org/argeo/cms/internal/osgi/GogoShellKiller.java index 9de7a4fd1..332f5cb8c 100644 --- a/org.argeo.cms/src/org/argeo/cms/internal/osgi/GogoShellKiller.java +++ b/org.argeo.cms/src/org/argeo/cms/internal/osgi/GogoShellKiller.java @@ -30,7 +30,7 @@ class GogoShellKiller extends Thread { return; System.exit(0); // No non-deamon threads left, forcibly halting the VM - //Runtime.getRuntime().halt(0); + // Runtime.getRuntime().halt(0); } private ThreadGroup getRootThreadGroup(ThreadGroup tg) { @@ -56,7 +56,7 @@ class GogoShellKiller extends Thread { Thread[] threads = new Thread[rootThreadGroup.activeCount()]; rootThreadGroup.enumerate(threads, true); for (Thread thread : threads) { - if (thread.getName().equals("pipe-gosh --login --noshutdown")) + if (thread.getName() != null && thread.getName().equals("pipe-gosh --login --noshutdown")) return thread; } return null;