summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--internal/pkg/table/policy.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/pkg/table/policy.go b/internal/pkg/table/policy.go
index 44feebd6..6e97723c 100644
--- a/internal/pkg/table/policy.go
+++ b/internal/pkg/table/policy.go
@@ -370,6 +370,12 @@ func (lhs *PrefixSet) Append(arg DefinedSet) error {
if !ok {
return fmt.Errorf("type cast failed")
}
+
+ if rhs.tree.Len() == 0 {
+ // if try to append an empty set, then return directly
+ return nil
+ }
+
// if either is empty, family can be ignored.
if lhs.tree.Len() != 0 && rhs.tree.Len() != 0 {
_, w, _ := lhs.tree.Minimum()