diff options
author | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-06-30 19:53:12 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-07-01 21:27:31 +0900 |
commit | 1db97a53022a02ff3bf355909b54eb6be8dc286e (patch) | |
tree | 6d99ec87beab4249faba771875e18d535a615b2f /policy/policy.go | |
parent | e47ae11969d356ec133e4379a4373e4a26906fbc (diff) |
cli: fix error output when routepolicy does not exist in routepolicy sub command
Diffstat (limited to 'policy/policy.go')
-rw-r--r-- | policy/policy.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/policy/policy.go b/policy/policy.go index 9ad7b349..d3e4ef03 100644 --- a/policy/policy.go +++ b/policy/policy.go @@ -1297,6 +1297,9 @@ func AsPathLengthToConfigStruct(reqAsPathLength *api.AsPathLength) config.AsPath func ConditionsToConfigStruct(reqConditions *api.Conditions) config.Conditions { conditions := config.Conditions{} + if reqConditions == nil { + return conditions + } if reqConditions.MatchPrefixSet != nil { conditions.MatchPrefixSet = reqConditions.MatchPrefixSet.PrefixSetName } @@ -1346,6 +1349,9 @@ func ActionsToApiStruct(conActions config.Actions) *api.Actions { func ActionsToConfigStruct(reqActions *api.Actions) config.Actions { actions := config.Actions{} + if reqActions == nil{ + return actions + } if reqActions.Community != nil { actions.BgpActions.SetCommunity.Communities = reqActions.Community.Communities actions.BgpActions.SetCommunity.Options = reqActions.Community.Options |