Repository: kylin
Updated Branches:
  refs/heads/master 77d5d7d62 -> 6957fd767


KYLIN-2262 Get null error when trigger a build with wrong cube name


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/6957fd76
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/6957fd76
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/6957fd76

Branch: refs/heads/master
Commit: 6957fd767056864fc8e3898f2c2fc28ffbd51d03
Parents: 77d5d7d
Author: shaofengshi <shaofeng...@apache.org>
Authored: Sun Dec 11 15:04:45 2016 +0800
Committer: shaofengshi <shaofeng...@apache.org>
Committed: Sun Dec 11 15:04:45 2016 +0800

----------------------------------------------------------------------
 .../java/org/apache/kylin/rest/controller/CubeController.java    | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/6957fd76/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
----------------------------------------------------------------------
diff --git 
a/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
 
b/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
index c38ec4c..416fc88 100644
--- 
a/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
+++ 
b/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
@@ -287,6 +287,10 @@ public class CubeController extends BasicController {
         try {
             String submitter = 
SecurityContextHolder.getContext().getAuthentication().getName();
             CubeInstance cube = jobService.getCubeManager().getCube(cubeName);
+
+            if (cube == null) {
+                throw new IllegalArgumentException("Cube with name '" + 
cubeName + "' was not found.");
+            }
             return jobService.submitJob(cube, startTime, endTime, startOffset, 
endOffset, //
                     sourcePartitionOffsetStart, sourcePartitionOffsetEnd, 
CubeBuildTypeEnum.valueOf(buildType), force, submitter);
         } catch (Exception e) {

Reply via email to