Author: arunpatidar
Date: Sat Jun 20 16:04:04 2015
New Revision: 1686648
URL: http://svn.apache.org/r1686648
Log:
Applied changes from trunk rev:1686642 to fix NPE.
Modified:
ofbiz/branches/release14.12/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java
Modified:
ofbiz/branches/release14.12/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release14.12/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java?rev=1686648&r1=1686647&r2=1686648&view=diff
==============================================================================
---
ofbiz/branches/release14.12/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java
(original)
+++
ofbiz/branches/release14.12/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java
Sat Jun 20 16:04:04 2015
@@ -331,6 +331,7 @@ public class ProductConfigWorker {
configItemId =
ci.getConfigItemAssoc().getString("configItemId");
sequenceNum = ci.getConfigItemAssoc().getLong("sequenceNum");
for (ConfigOption oneOption: selectedOptions) {
+ Map<String, String> componentOptions =
oneOption.componentOptions;
List<GenericValue> toBeStored = FastList.newInstance();
String configOptionId =
oneOption.configOption.getString("configOptionId");
String description = oneOption.getComments();
@@ -345,8 +346,8 @@ public class ProductConfigWorker {
if (oneOption.hasVirtualComponent()) {
List<GenericValue> components =
oneOption.getComponents();
for (GenericValue component: components) {
- if (oneOption.isVirtualComponent(component)) {
- String componentOption =
oneOption.componentOptions.get(component.getString("productId"));
+ if (oneOption.isVirtualComponent(component) &&
UtilValidate.isNotEmpty(componentOptions)) {
+ String componentOption =
componentOptions.get(component.getString("productId"));
GenericValue configOptionProductOption =
delegator.makeValue("ConfigOptionProductOption");
configOptionProductOption.put("configId",
configId);
configOptionProductOption.put("configItemId",
configItemId);