You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/03/15 17:02:23 UTC

[tomcat] branch main updated: Avoid possible NPE

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

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 74d1be0  Avoid possible NPE
74d1be0 is described below

commit 74d1be0ff0824562506f25cafc9beffaf12033c1
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Mar 15 16:47:05 2022 +0000

    Avoid possible NPE
    
    No functional change since NPE would be swallowed but this saves
    generating the NPE.
---
 java/org/apache/tomcat/util/IntrospectionUtils.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/IntrospectionUtils.java b/java/org/apache/tomcat/util/IntrospectionUtils.java
index a1f718d..ff13d11 100644
--- a/java/org/apache/tomcat/util/IntrospectionUtils.java
+++ b/java/org/apache/tomcat/util/IntrospectionUtils.java
@@ -303,7 +303,7 @@ public final class IntrospectionUtils {
     private static String replaceProperties(String value,
             Hashtable<Object,Object> staticProp, PropertySource dynamicProp[],
             ClassLoader classLoader, int iterationCount) {
-        if (value.indexOf("${") < 0) {
+        if (value == null || value.indexOf("${") < 0) {
             return value;
         }
         if (iterationCount >=20) {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org