Repository: sqoop Updated Branches: refs/heads/branch-1.99.4 fedc12a65 -> ae78e3e27
SQOOP-1668: Update existing job meets NPE (Qian Xu via Jarek Jarcec Cecho) Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/ae78e3e2 Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/ae78e3e2 Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/ae78e3e2 Branch: refs/heads/branch-1.99.4 Commit: ae78e3e27578bea2ab65a8a6c478f8f065255ba5 Parents: fedc12a Author: Jarek Jarcec Cecho <[email protected]> Authored: Tue Nov 4 10:01:12 2014 -0800 Committer: Jarek Jarcec Cecho <[email protected]> Committed: Tue Nov 4 10:03:55 2014 -0800 ---------------------------------------------------------------------- .../apache/sqoop/handler/JobRequestHandler.java | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/ae78e3e2/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java index 8130805..6e3983e 100644 --- a/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java +++ b/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java @@ -102,18 +102,19 @@ public class JobRequestHandler implements RequestHandler { return createUpdateJob(ctx, true); case PUT: JobAction action = JobAction.fromString(ctx.getLastURLElement()); - switch (action) { - case ENABLE: - return enableJob(ctx, true); - case DISABLE: - return enableJob(ctx, false); - case START: - return startJob(ctx); - case STOP: - return stopJob(ctx); - default: - return createUpdateJob(ctx, false); + if (action != null) { + switch (action) { + case ENABLE: + return enableJob(ctx, true); + case DISABLE: + return enableJob(ctx, false); + case START: + return startJob(ctx); + case STOP: + return stopJob(ctx); + } } + return createUpdateJob(ctx, false); case DELETE: return deleteJob(ctx); }
