You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/12/04 15:11:20 UTC

[commons-vfs] branch master updated: Fix NullPointerException when the current thread is stopped.

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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
     new 2f3fe3c  Fix NullPointerException when the current thread is stopped.
2f3fe3c is described below

commit 2f3fe3c6b5dc3b4f5019feba37131f9ec242f6f4
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 4 10:11:16 2021 -0500

    Fix NullPointerException when the current thread is stopped.
---
 .../src/test/java/org/apache/commons/vfs2/AbstractTestSuite.java       | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractTestSuite.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractTestSuite.java
index 4d9d442..8500ae3 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractTestSuite.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractTestSuite.java
@@ -133,6 +133,9 @@ public abstract class AbstractTestSuite extends TestSetup {
 
     private Thread[] createThreadSnapshot() {
         ThreadGroup tg = Thread.currentThread().getThreadGroup();
+        if (tg == null) {
+            return EMPTY_THREAD_ARRAY;
+        }
         while (tg.getParent() != null) {
             tg = tg.getParent();
         }