Skip to content
Snippets Groups Projects
Commit 60bbd301 authored by Maximilian Giller's avatar Maximilian Giller
Browse files

Fixed exception when trying to parse empty graph

parent 3af06eb5
No related branches found
No related tags found
1 merge request!2Implemented editor in the react framework
...@@ -304,9 +304,9 @@ export class Graph extends ManagedData { ...@@ -304,9 +304,9 @@ export class Graph extends ManagedData {
// No need to replace node ids with proper node objects, since that should be done in the graph itself. Only have to prepare valid GraphData // No need to replace node ids with proper node objects, since that should be done in the graph itself. Only have to prepare valid GraphData
}); });
// Collect all node types and give id of none given yet // Collect all node types and give id if none given yet
let typeId: number = undefined; let typeId: number = undefined;
if (data.nodes[0].type.id === undefined) { if (data.nodes.length > 0 && data.nodes[0].type.id === undefined) {
typeId = 0; typeId = 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment