Skip to content

Commit

Permalink
fix #13
Browse files Browse the repository at this point in the history
  • Loading branch information
veo committed Apr 27, 2022
1 parent 5f65776 commit fb04b4c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pocs_yml/pkg/xray/structs/poc.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package structs

import "gopkg.in/yaml.v2"
import (
"gopkg.in/yaml.v2"
)

var ORDER = 0

Expand Down Expand Up @@ -118,9 +120,11 @@ func (m *RuleMapSlice) UnmarshalYAML(unmarshal func(interface{}) error) error {
newRuleSlice := make([]RuleMapItem, len(tempMap))

for roleName, role := range tempMap {
newRuleSlice[role.order] = RuleMapItem{
Key: roleName,
Value: role,
if role.order < len(tempMap) {
newRuleSlice[role.order] = RuleMapItem{
Key: roleName,
Value: role,
}
}
}

Expand Down

0 comments on commit fb04b4c

Please sign in to comment.