Skip to content

Commit f3e96ac

Browse files
committed
#netpyne-92 feat: Fix issue with filter in treepanel
1 parent 5dea291 commit f3e96ac

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

webapp/components/general/ControlPanelTreeItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ const ControlPanelTreeItem = (props) => {
129129
const getColor = (nodeId) => {
130130
const insts = instances.filter((instance) => instance.instancePath === nodeId);
131131
const hasChildren = instances.some((instance) => instance.instancePath.startsWith(nodeId) && instance.instancePath !== nodeId);
132-
if (props.children.length === 0 && insts.length > 0 && "color" in insts[0]) {
132+
if (props.children && props.children.length === 0 && insts.length > 0 && "color" in insts[0]) {
133133
return insts[0].color
134134
}
135135
// we check if all children have the same color

0 commit comments

Comments
 (0)