File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -636,7 +636,9 @@ func (m *Map) ExtractSubIndexLists(root string) []string {
636
636
637
637
// if there are no subindexed then return the whole "roox.xxx" subtree
638
638
if ! haveIndexedProperties {
639
- res = append (res , m .Get (root ))
639
+ if value , ok := m .GetOk (root ); ok {
640
+ res = append (res , value )
641
+ }
640
642
}
641
643
642
644
return res
Original file line number Diff line number Diff line change @@ -356,6 +356,7 @@ func TestExtractSubIndexLists(t *testing.T) {
356
356
"quattro.discovery.required" : "itemA" ,
357
357
"quattro.discovery.required.1" : "itemB" ,
358
358
"quattro.discovery.required.2" : "itemC" ,
359
+ "cinque.discovery.something" : "itemX" ,
359
360
}
360
361
m := NewFromHashmap (data )
361
362
@@ -379,4 +380,7 @@ func TestExtractSubIndexLists(t *testing.T) {
379
380
require .Len (t , s4 , 2 )
380
381
require .Equal (t , s4 [0 ], "itemB" )
381
382
require .Equal (t , s4 [1 ], "itemC" )
383
+
384
+ s5 := m .ExtractSubIndexLists ("cinque.discovery.required" )
385
+ require .Len (t , s5 , 0 )
382
386
}
You can’t perform that action at this time.
0 commit comments