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:37 UTC

[tomcat] branch 8.5.x updated: Avoid possible NPE

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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 0346b14  Avoid possible NPE
0346b14 is described below

commit 0346b14f0de67140389cb7943800351fd4caebaa
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 82a83f5..a10a42c 100644
--- a/java/org/apache/tomcat/util/IntrospectionUtils.java
+++ b/java/org/apache/tomcat/util/IntrospectionUtils.java
@@ -269,7 +269,7 @@ public final class IntrospectionUtils {
             Hashtable<Object,Object> staticProp, PropertySource dynamicProp[],
             ClassLoader classLoader) {
 
-        if (value.indexOf('$') < 0) {
+        if (value == null || value.indexOf('$') < 0) {
             return value;
         }
         StringBuilder sb = new StringBuilder();

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