Author: byersa
Date: Wed Feb 7 23:53:45 2007 New Revision: 504816 URL: http://svn.apache.org/viewvc?view=rev&rev=504816 Log: Put a test for null result map, like in ServiceEventHandler. Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java?view=diff&rev=504816&r1=504815&r2=504816 ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java Wed Feb 7 23:53:45 2007 @@ -311,25 +311,29 @@ errorMessages.add(messagePrefixStr + "Service invocation error on row (" + i +"): " + e.getNested() + messageSuffixStr); } - // check for an error message - String errorMessage = ServiceUtil.makeErrorMessage(result, messagePrefixStr, messageSuffixStr, "", ""); - if (UtilValidate.isNotEmpty(errorMessage)) { - errorMessages.add(errorMessage); - } - - // get the success messages - if (!UtilValidate.isEmpty((String)result.get(ModelService.SUCCESS_MESSAGE))) { - String newSuccessMessage = (String)result.get(ModelService.SUCCESS_MESSAGE); - if (!successMessages.contains(newSuccessMessage)) { - successMessages.add(newSuccessMessage); + if (result == null) { + returnString = ModelService.RESPOND_SUCCESS; + } else { + // check for an error message + String errorMessage = ServiceUtil.makeErrorMessage(result, messagePrefixStr, messageSuffixStr, "", ""); + if (UtilValidate.isNotEmpty(errorMessage)) { + errorMessages.add(errorMessage); } - } - if (!UtilValidate.isEmpty((List)result.get(ModelService.SUCCESS_MESSAGE_LIST))) { - List newSuccessMessages = (List)result.get(ModelService.SUCCESS_MESSAGE_LIST); - for (int j = 0; j < newSuccessMessages.size(); j++) { - String newSuccessMessage = (String)newSuccessMessages.get(j); + + // get the success messages + if (!UtilValidate.isEmpty((String)result.get(ModelService.SUCCESS_MESSAGE))) { + String newSuccessMessage = (String)result.get(ModelService.SUCCESS_MESSAGE); if (!successMessages.contains(newSuccessMessage)) { successMessages.add(newSuccessMessage); + } + } + if (!UtilValidate.isEmpty((List)result.get(ModelService.SUCCESS_MESSAGE_LIST))) { + List newSuccessMessages = (List)result.get(ModelService.SUCCESS_MESSAGE_LIST); + for (int j = 0; j < newSuccessMessages.size(); j++) { + String newSuccessMessage = (String)newSuccessMessages.get(j); + if (!successMessages.contains(newSuccessMessage)) { + successMessages.add(newSuccessMessage); + } } } } |
Free forum by Nabble | Edit this page |