You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by am...@apache.org on 2017/02/13 18:16:13 UTC

struts git commit: WW-4743 NPE in StrutsTilesContainerFactory when resource isn't found

Repository: struts
Updated Branches:
  refs/heads/master f22873e12 -> a399932ae


WW-4743 NPE in StrutsTilesContainerFactory when resource isn't found


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/a399932a
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/a399932a
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/a399932a

Branch: refs/heads/master
Commit: a399932ae9903167d1ee647b141cc98fdf83ef6f
Parents: f22873e
Author: Aleksandr Mashchenko <am...@apache.org>
Authored: Mon Feb 13 20:15:18 2017 +0200
Committer: Aleksandr Mashchenko <am...@apache.org>
Committed: Mon Feb 13 20:15:18 2017 +0200

----------------------------------------------------------------------
 .../org/apache/struts2/tiles/StrutsTilesContainerFactory.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/a399932a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
----------------------------------------------------------------------
diff --git a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
index f1c8bbb..b7564a9 100644
--- a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
@@ -190,9 +190,13 @@ public class StrutsTilesContainerFactory extends BasicTilesContainerFactory {
             resources.addAll(applicationContext.getResources(definition));
         }
 
+        if (resources.contains(null)) {
+            LOG.warn("Some resources were not found. Definitions: {}. Found resources: {}", definitions, resources);
+        }
+
         List<ApplicationResource> filteredResources = new ArrayList<>();
         for (ApplicationResource resource : resources) {
-            if (Locale.ROOT.equals(resource.getLocale())) {
+            if (resource != null && Locale.ROOT.equals(resource.getLocale())) {
                 filteredResources.add(resource);
             }
         }