From 583cb024a1cc440250859ffcb4cb4d0c4bd69e4e Mon Sep 17 00:00:00 2001 From: Unick Soft Date: Sun, 3 May 2020 21:46:33 +0200 Subject: [PATCH] Fix create graph by matrix. --- script/BaseEdge.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/BaseEdge.js b/script/BaseEdge.js index 1757e30..09ee243 100755 --- a/script/BaseEdge.js +++ b/script/BaseEdge.js @@ -17,7 +17,11 @@ function BaseEdge(vertex1, vertex2, isDirect, weight, upText) this.useWeight = false; this.id = 0; this.model = new EdgeModel(); - this.upText = upText; + + if (upText === undefined) + this.upText = ""; + else + this.upText = upText; if (weight !== undefined) this.SetWeight(weight);