ignite-1.5 Fixed NPE in IgniteKernal.dumpDebugInfo.

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

Branch: refs/heads/ignite-2100
Commit: acb57c5eb95d11ebde5557618226d80f25ac610c
Parents: 717dab2
Author: sboikov <[email protected]>
Authored: Mon Dec 14 10:40:57 2015 +0300
Committer: sboikov <[email protected]>
Committed: Mon Dec 14 10:40:57 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    | 26 ++++++++++++--------
 1 file changed, 16 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/acb57c5e/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java 
b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 4fb5d4a..0f781d6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -3244,20 +3244,26 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 
     /** {@inheritDoc} */
     public void dumpDebugInfo() {
-        boolean client = ctx.clientNode();
+        GridKernalContextImpl ctx = this.ctx;
 
-        ClusterNode locNode = ctx.discovery().localNode();
+        if (ctx != null) {
+            boolean client = ctx.clientNode();
 
-        UUID routerId = locNode instanceof TcpDiscoveryNode ? 
((TcpDiscoveryNode)locNode).clientRouterNodeId() : null;
+            ClusterNode locNode = ctx.discovery().localNode();
 
-        U.warn(log, "Dumping debug info for node [id=" + locNode.id() +
-            ", name=" + ctx.gridName() +
-            ", order=" + locNode.order() +
-            ", topVer=" + ctx.discovery().topologyVersion() +
-            ", client=" + client +
-            (client && routerId != null ? ", routerId=" + routerId : "") + 
']');
+            UUID routerId = locNode instanceof TcpDiscoveryNode ? 
((TcpDiscoveryNode)locNode).clientRouterNodeId() : null;
 
-        ctx.cache().context().exchange().dumpDebugInfo();
+            U.warn(log, "Dumping debug info for node [id=" + locNode.id() +
+                ", name=" + ctx.gridName() +
+                ", order=" + locNode.order() +
+                ", topVer=" + ctx.discovery().topologyVersion() +
+                ", client=" + client +
+                (client && routerId != null ? ", routerId=" + routerId : "") + 
']');
+
+            ctx.cache().context().exchange().dumpDebugInfo();
+        }
+        else
+            U.warn(log, "Dumping debug info for node, context is not 
initialized [name=" + gridName + ']');
     }
 
     /** {@inheritDoc} */

Reply via email to