Author: arunpatidar
Date: Sat Jun 20 16:04:42 2015
New Revision: 1686649
URL: http://svn.apache.org/r1686649
Log:
Applied changes from trunk rev:1686642 to fix NPE.
Modified:
ofbiz/branches/release13.07/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java
Modified:
ofbiz/branches/release13.07/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java?rev=1686649&r1=1686648&r2=1686649&view=diff
==============================================================================
---
ofbiz/branches/release13.07/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java
(original)
+++
ofbiz/branches/release13.07/applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java
Sat Jun 20 16:04:42 2015
@@ -329,6 +329,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();
@@ -343,8 +344,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);