diff --git a/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts b/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts index a90e36ff..208ccd88 100644 --- a/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts +++ b/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts @@ -271,7 +271,7 @@ export class GraphComponent implements OnInit, OnChanges, OnDestroy, AfterViewIn if (layoutSettings) { this.setLayoutSettings(this.layoutSettings); } - if (this.layout && this.nodes.length && this.links.length) { + if (this.layout && this.nodes && this.links) { this.update(); } }