Fixed: CategoryServices returns null when opening Product main page
Increase parsing control to don't realize it on null value for viewSizeString
when call service getProductCategoryAndLimitedMembers.
Thanks Jacques Leroux for raise this issue
@@ -236,17 +236,23 @@ public class CategoryServices {
Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
int viewIndex = 0;
+ if (context.containsKey("viewIndexString")) {
try {
viewIndex = Integer.parseInt((String) context.get("viewIndexString"));
} catch (Exception e) {
viewIndex = 0;
}
+ }
int viewSize = defaultViewSize;
+ if (context.containsKey("viewSizeString")) {
try {
viewSize = Integer.parseInt((String) context.get("viewSizeString"));
} catch (NumberFormatException e) {
- Debug.logError(e.getMessage(), module);
+ Debug.logWarning("Fail to parse viewSizeString "
+ + context.get("viewSizeString")
+ + " " + e.getMessage(), module);
+ }
}
GenericValue productCategory;
