summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gobgp/cmd/global.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/gobgp/cmd/global.go b/gobgp/cmd/global.go
index a02de92a..c9bc97d6 100644
--- a/gobgp/cmd/global.go
+++ b/gobgp/cmd/global.go
@@ -254,9 +254,6 @@ func ParseExtendedCommunities(input string) ([]bgp.ExtendedCommunityInterface, e
for i, idx := range idxs {
var a []string
f := ExtCommParserMap[idx.t]
- if f == nil {
- continue
- }
if i < len(idxs)-1 {
a = args[:idxs[i+1].i-idx.i]
args = args[(idxs[i+1].i - idx.i):]
@@ -264,6 +261,9 @@ func ParseExtendedCommunities(input string) ([]bgp.ExtendedCommunityInterface, e
a = args
args = nil
}
+ if f == nil {
+ continue
+ }
ext, err := f(a)
if err != nil {
return nil, err