struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [struts] branch master updated: Fix NPE in XmlConfigurationProvider.java
Date Fri, 18 Jun 2021 04:54:48 GMT
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git


The following commit(s) were added to refs/heads/master by this push:
     new 621fea9  Fix NPE in XmlConfigurationProvider.java
     new d3f0761  Merge pull request #491 from containerAnalyzer/master
621fea9 is described below

commit 621fea935b61b549ae9f547f704d3c75781515ea
Author: containerAnalyzer <85693199+containerAnalyzer@users.noreply.github.com>
AuthorDate: Tue Jun 15 22:41:10 2021 +0800

    Fix NPE in XmlConfigurationProvider.java
---
 .../xwork2/config/providers/XmlConfigurationProvider.java         | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
b/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
index e02338f..8d9699a 100644
--- a/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
+++ b/core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
@@ -1076,8 +1076,12 @@ public abstract class XmlConfigurationProvider implements ConfigurationProvider
                     InputSource in = new InputSource(is);
 
                     in.setSystemId(url.toString());
-
-                    docs.add(DomHelper.parse(in, dtdMappings));
+                    
+                    Document helperDoc = DomHelper.parse(in, dtdMappings);
+                    if (helperDoc != null) {
+                        docs.add(helperDoc);
+                    }
+                    
                     loadedFileUrls.add(url.toString());
                 } catch (StrutsException e) {
                     if (includeElement != null) {

Mime
View raw message