Commits

Anonymous committed 66fa313

Checks for null message text keys

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@365e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits b90ea0f

Comments (0)

Files changed (2)

File src/java/com/opensymphony/xwork/util/LocalizedTextUtil.java

         ActionContext context = ActionContext.getContext();
         OgnlValueStack valueStack = context.getValueStack();
         String indexedTextName = null;
-
+        if (aTextName == null) {
+            LOG.warn("Trying to find text with null key!");
+            aTextName = "";
+        }
         // calculate indexedTextName (collection[*]) if applicable
         if (aTextName.indexOf("[") != -1) {
             int i = -1;

File src/test/com/opensymphony/xwork/util/LocalizedTextUtilTest.java

         }
     }
 
+    public void testNullKeys() {
+        LocalizedTextUtil.findText(this.getClass(),null,Locale.getDefault());
+    }
+
     public void testActionGetTextXXX() {
         try {
             LocalizedTextUtil.addDefaultResourceBundle("com/opensymphony/xwork/util/FindMe");