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