Closed james-strauss-uwa closed 1 week ago
The PR fixes a bug in the graph loading logic by adding a check for empty graph configurations. When no graph configs exist, the code now explicitly sets the activeGraphConfigId to undefined instead of attempting to access a non-existent array element.
classDiagram
class LogicalGraph {
+activeGraphConfigId: GraphConfig.Id
+graphConfigs(): GraphConfig[]
+loadGraph(dataObject)
}
class GraphConfig {
+getId(): Id
}
LogicalGraph --> GraphConfig
note for LogicalGraph "Added check for empty graphConfigs array before setting activeGraphConfigId."
Change | Details | Files |
---|---|---|
Added null check for empty graph configurations |
|
src/LogicalGraph.ts |
Fixed bug where code would try to set last graph config as active, even when no graph configs exist.
Now the code checks that at least one graph config exists. If none exist, then graph.activeGraphConfigId is set to undefined.
Summary by Sourcery
Bug Fixes: