5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-17 09:20:43 +08:00

SQOOP-1668: Update existing job meets NPE

(Qian Xu via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2014-11-04 10:01:12 -08:00
parent fedc12a65e
commit ae78e3e275

View File

@ -102,6 +102,7 @@ public JsonBean handleEvent(RequestContext ctx) {
return createUpdateJob(ctx, true); return createUpdateJob(ctx, true);
case PUT: case PUT:
JobAction action = JobAction.fromString(ctx.getLastURLElement()); JobAction action = JobAction.fromString(ctx.getLastURLElement());
if (action != null) {
switch (action) { switch (action) {
case ENABLE: case ENABLE:
return enableJob(ctx, true); return enableJob(ctx, true);
@ -111,9 +112,9 @@ public JsonBean handleEvent(RequestContext ctx) {
return startJob(ctx); return startJob(ctx);
case STOP: case STOP:
return stopJob(ctx); return stopJob(ctx);
default:
return createUpdateJob(ctx, false);
} }
}
return createUpdateJob(ctx, false);
case DELETE: case DELETE:
return deleteJob(ctx); return deleteJob(ctx);
} }