Author: jacopoc
Date: Wed Oct 25 10:08:37 2006
New Revision: 467712
URL:
http://svn.apache.org/viewvc?view=rev&rev=467712Log:
Fixed NPE when a wrong service name was used in the schedule job screen.
Modified:
incubator/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/scheduleJob.bsh
Modified: incubator/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/scheduleJob.bsh
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/scheduleJob.bsh?view=diff&rev=467712&r1=467711&r2=467712==============================================================================
--- incubator/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/scheduleJob.bsh (original)
+++ incubator/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/service/scheduleJob.bsh Wed Oct 25 10:08:37 2006
@@ -47,14 +47,21 @@
if (UtilValidate.isNotEmpty(serviceName)) {
DispatchContext dctx = dispatcher.getDispatchContext();
- ModelService model = dctx.getModelService(serviceName);
- Iterator params = model.getInParamNames().iterator();
- while (params.hasNext()) {
- ModelParam par = model.getParam((String)params.next());
- if (par.internal) {
- continue;
+ ModelService model = null;
+ try {
+ model = dctx.getModelService(serviceName);
+ } catch(Exception exc) {
+ context.put("errorMessageList", UtilMisc.toList(exc.getMessage()));
+ }
+ if (model != null) {
+ Iterator params = model.getInParamNames().iterator();
+ while (params.hasNext()) {
+ ModelParam par = model.getParam((String)params.next());
+ if (par.internal) {
+ continue;
+ }
+ serviceParameters.add(UtilMisc.toMap("name", par.name, "type", par.type, "optional", (par.optional? "Y": "N")));
}
- serviceParameters.add(UtilMisc.toMap("name", par.name, "type", par.type, "optional", (par.optional? "Y": "N")));
}
}
context.put("serviceParameters", serviceParameters);