ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [1/2] ignite git commit: IGNITE-2520 Fixed possible npe.
Date Tue, 09 Feb 2016 07:23:47 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc2 d43908b3e -> 07ef27872


IGNITE-2520 Fixed possible npe.


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

Branch: refs/heads/ignite-843-rc2
Commit: 08725201722fcb542cd45067698e928ffed59156
Parents: d43908b
Author: Andrey <anovikov@gridgain.com>
Authored: Tue Feb 9 13:59:23 2016 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Tue Feb 9 13:59:23 2016 +0700

----------------------------------------------------------------------
 .../ignite/console/agent/handlers/RestExecutor.java   | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/08725201/modules/control-center-agent/src/main/java/org/apache/ignite/console/agent/handlers/RestExecutor.java
----------------------------------------------------------------------
diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/console/agent/handlers/RestExecutor.java
b/modules/control-center-agent/src/main/java/org/apache/ignite/console/agent/handlers/RestExecutor.java
index 2f87726..3eb869b 100644
--- a/modules/control-center-agent/src/main/java/org/apache/ignite/console/agent/handlers/RestExecutor.java
+++ b/modules/control-center-agent/src/main/java/org/apache/ignite/console/agent/handlers/RestExecutor.java
@@ -91,10 +91,20 @@ public class RestExecutor {
         String mtd, Map<String, String> headers, String body) throws IOException, URISyntaxException
{
         log.debug("Start execute REST command [method=" + mtd + ", uri=/" + uri + ", parameters="
+ params + "]");
 
-        if (demo)
+        final URIBuilder builder;
+
+        if (demo) {
+            // try start demo if needed.
             AgentSqlDemo.testDrive(cfg);
 
-        URIBuilder builder = new URIBuilder(demo ? cfg.demoNodeUri() : cfg.nodeUri());
+            // null if demo node not started yet.
+            if (cfg.demoNodeUri() == null)
+                return RestResult.fail(404, "Demo node is not started yet.");
+
+            builder = new URIBuilder(cfg.demoNodeUri());
+        }
+        else
+            builder = new URIBuilder(cfg.nodeUri());
 
         if (builder.getPort() == -1)
             builder.setPort(DFLT_NODE_PORT);


Mime
View raw message