Commits

plightbo  committed 23678ee
  • Participants
  • Parent commits 7132fe7

Comments (0)

Files changed (1)

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

 
         do {
             try {
-                String packageName = clazz.getPackage().getName();
-                ResourceBundle bundle = findResourceBundle(packageName + ".package", locale);
-                reloadBundles(bundle);
+                if (clazz != null && clazz.getPackage() != null) {
+                    String packageName = clazz.getPackage().getName();
+                    ResourceBundle bundle = findResourceBundle(packageName + ".package", locale);
+                    reloadBundles(bundle);
 
-                String message = TextParseUtil.translateVariables(bundle.getString(aTextName), valueStack);
+                    String message = TextParseUtil.translateVariables(bundle.getString(aTextName), valueStack);
 
-                return MessageFormat.format(message, args);
+                    return MessageFormat.format(message, args);
+                }
             } catch (MissingResourceException ex) {
                 clazz = clazz.getSuperclass();
             }