mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 06:37:56 +01:00
Fix NPE.
This commit is contained in:
parent
4dc64111c0
commit
bcee2e21d4
@ -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';
|
||||||
|
@ -41,14 +41,16 @@ class Point {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Point.fromString = function pointFromString(point) {
|
Point.fromString = function pointFromString(point) {
|
||||||
const values = point.split(',');
|
|
||||||
let result = null;
|
let result = null;
|
||||||
if (values.lenght > 1) {
|
if (point) {
|
||||||
const x = Number.parseInt(values[0], 10);
|
const values = point.split(',');
|
||||||
const y = Number.parseInt(values[1], 10);
|
if (values.lenght > 1) {
|
||||||
|
const x = Number.parseInt(values[0], 10);
|
||||||
|
const y = Number.parseInt(values[1], 10);
|
||||||
|
|
||||||
if (!Number.isNaN(x) && !Number.isNaN(y)) {
|
if (!Number.isNaN(x) && !Number.isNaN(y)) {
|
||||||
result = new Point(x, y);
|
result = new Point(x, y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
Reference in New Issue
Block a user