This commit is contained in:
Paulo Gustavo Veiga 2022-11-30 19:21:14 -08:00
parent 4dc64111c0
commit bcee2e21d4
2 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,4 @@
import xmlFormatter from 'xml-formatter'; import xmlFormatter from 'xml-formatter';
import { off } from 'process';
import Importer from './Importer'; import Importer from './Importer';
import Mindmap from '../model/Mindmap'; import Mindmap from '../model/Mindmap';
import RelationshipModel from '../model/RelationshipModel'; import RelationshipModel from '../model/RelationshipModel';

View File

@ -41,8 +41,9 @@ class Point {
} }
Point.fromString = function pointFromString(point) { Point.fromString = function pointFromString(point) {
const values = point.split(',');
let result = null; let result = null;
if (point) {
const values = point.split(',');
if (values.lenght > 1) { if (values.lenght > 1) {
const x = Number.parseInt(values[0], 10); const x = Number.parseInt(values[0], 10);
const y = Number.parseInt(values[1], 10); const y = Number.parseInt(values[1], 10);
@ -51,6 +52,7 @@ Point.fromString = function pointFromString(point) {
result = new Point(x, y); result = new Point(x, y);
} }
} }
}
return result; return result;
}; };