From 2d7bbf60cc53d0da68826459971e49088b8c849b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 12 Sep 2023 15:34:09 +0530 Subject: [PATCH] Fix #6615 --- tools/utils/set.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/utils/set.go b/tools/utils/set.go index 70f9f8267..9965d0880 100644 --- a/tools/utils/set.go +++ b/tools/utils/set.go @@ -60,6 +60,9 @@ func (self *Set[T]) AsSlice() []T { } func (self *Set[T]) Intersect(other *Set[T]) (ans *Set[T]) { + if other == nil { + return NewSet[T]() + } if self.Len() < other.Len() { ans = NewSet[T](self.Len()) for x := range self.items {