File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -32,17 +32,23 @@ func (d *dnsApex) check(e *et.Event) error {
32
32
}
33
33
34
34
// determine which domain apex is the parent of this name
35
- var apex * dbt. Entity
35
+ var name string
36
36
best := len (fqdn .Name )
37
- for _ , name := range d .plugin .apexList .Slice () {
38
- if idx := strings .Index (fqdn .Name , name ); idx != - 1 && idx != 0 && idx < best {
37
+ for _ , n := range d .plugin .apexList .Slice () {
38
+ if idx := strings .Index (fqdn .Name , n ); idx != - 1 && idx != 0 && idx < best {
39
39
best = idx
40
- if ents , err := e .Session .Cache ().FindEntitiesByContent (
41
- & oamdns.FQDN {Name : name }, e .Session .Cache ().StartTime ()); err == nil && len (ents ) == 1 {
42
- apex = ents [0 ]
43
- }
40
+ name = n
44
41
}
45
42
}
43
+ if name == "" {
44
+ return nil
45
+ }
46
+
47
+ var apex * dbt.Entity
48
+ if ents , err := e .Session .Cache ().FindEntitiesByContent (
49
+ & oamdns.FQDN {Name : name }, e .Session .Cache ().StartTime ()); err == nil && len (ents ) == 1 {
50
+ apex = ents [0 ]
51
+ }
46
52
47
53
if apex != nil && apex .Asset .Key () != fqdn .Name {
48
54
d .store (e , fqdn .Name , e .Entity , apex )
You can’t perform that action at this time.
0 commit comments