Fixes: Can't find resource for bundle
(OFBIZ-8336) When going for example to EditProductContent (Product --> Content) the following error message appears: 2016-09-27 20:02:40,822 |http-nio-8444-exec-7 |UtilProperties |I| null java.util.MissingResourceException: Can't find resource for bundle org.apache.ofbiz.base.util.UtilProperties$UtilResourceBundle, key FieldDescription.sequenceNum jleroux: this has not been handled right from start and in several changes later. Rather than throwing an exception in UtilProperties.getMessage() it's better to check if the bundle contains the key and else to log info Thanks: Ingo Wolfmayr for report and Rohit Koushal for research git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1763085 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -589,10 +589,11 @@ public final class UtilProperties implements Serializable {
|
||||
if (bundle == null) return name;
|
||||
|
||||
String value = null;
|
||||
try {
|
||||
if (bundle.containsKey(name)) {
|
||||
value = bundle.getString(name);
|
||||
} catch (Exception e) {
|
||||
Debug.logInfo(e, module);
|
||||
} else {
|
||||
Debug.logInfo(name + " misses in " + resource + " for locale " + locale, module);
|
||||
return name;
|
||||
}
|
||||
return value == null ? name : value.trim();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user