Protect against NPE whilst running the test
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 8 Feb 2010 13:27:45 +0000 (13:27 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 8 Feb 2010 13:27:45 +0000 (13:27 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@907651 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/catalina/loader/TestWebappClassLoaderMemoryLeak.java

index 5534e56..52882bd 100644 (file)
@@ -36,7 +36,8 @@ public class TestWebappClassLoaderMemoryLeak extends TomcatBaseTest {
         // If the thread still exists, we have a thread/memory leak
         Thread[] threads = getThreads();
         for (Thread thread : threads) {
-            if (thread.getName().equals(TaskServlet.TIMER_THREAD_NAME)) {
+            if (thread != null &&
+                    TaskServlet.TIMER_THREAD_NAME.equals(thread.getName())) {
                 fail("Timer thread still running");
             }
         }