[CORD-1117] XOS GUI Various fix

Change-Id: I4237a5e23509e9173c958d76aa929a70583ba1e6
diff --git a/src/app/service-graph/components/coarse/coarse.component.ts b/src/app/service-graph/components/coarse/coarse.component.ts
index d02bb23..c7a7ac5 100644
--- a/src/app/service-graph/components/coarse/coarse.component.ts
+++ b/src/app/service-graph/components/coarse/coarse.component.ts
@@ -80,6 +80,9 @@
   }
 
   private _renderGraph() {
+    if (!angular.isDefined(this.graph) || !angular.isDefined(this.graph.nodes) || !angular.isDefined(this.graph.links)) {
+      return;
+    }
     this.addNodeLinksToForceLayout(this.graph);
     this.renderNodes(this.graph.nodes);
     this.renderLinks(this.graph.links);
@@ -87,8 +90,8 @@
 
   private getSvgDimensions(): {width: number, heigth: number} {
     return {
-      width: $('xos-coarse-tenancy-graph svg').width(),
-      heigth: $('xos-coarse-tenancy-graph svg').height()
+      width: $('xos-coarse-tenancy-graph svg').width() || 0,
+      heigth: $('xos-coarse-tenancy-graph svg').height() || 0
     };
   }
 
diff --git a/src/app/service-graph/components/fine-grained/fine-grained.component.ts b/src/app/service-graph/components/fine-grained/fine-grained.component.ts
index 64955ae..d0aea83 100644
--- a/src/app/service-graph/components/fine-grained/fine-grained.component.ts
+++ b/src/app/service-graph/components/fine-grained/fine-grained.component.ts
@@ -83,6 +83,9 @@
   }
 
   private _renderGraph() {
+    if (!angular.isDefined(this.graph) || !angular.isDefined(this.graph.nodes) || !angular.isDefined(this.graph.links)) {
+      return;
+    }
     this.addNodeLinksToForceLayout(this.graph);
     this.renderNodes(this.graph.nodes);
     this.renderLinks(this.graph.links);