fix(ui): prevent nil pointer in completions size update (#2162)

kslamph created

Change summary

internal/ui/completions/completions.go | 3 +++
1 file changed, 3 insertions(+)

Detailed changes

internal/ui/completions/completions.go 🔗

@@ -182,6 +182,9 @@ func (c *Completions) updateSize() {
 	width := 0
 	for i := start; i <= end; i++ {
 		item := c.list.ItemAt(i)
+		if item == nil {
+			continue
+		}
 		s := item.(interface{ Text() string }).Text()
 		width = max(width, ansi.StringWidth(s))
 	}