Fixed panic when typed array is empty
All checks were successful
Build / build (push) Successful in 1m40s

This commit is contained in:
Leon Mika 2024-12-12 08:17:35 +11:00
parent dac0a59085
commit 4a527cfe3d

View file

@ -89,7 +89,7 @@ func (r *REPL) displayResult(ctx context.Context, w io.Writer, res any, concise
fmt.Fprintf(w, "]") fmt.Fprintf(w, "]")
} else { } else {
// In the off-chance that this is actually a slice of printables // In the off-chance that this is actually a slice of printables
vt := reflect.SliceOf(reflect.TypeOf(v[0])) vt := reflect.ValueOf(res).Type()
if tp, ok := r.typePrinters[vt]; ok { if tp, ok := r.typePrinters[vt]; ok {
canDisplay := true canDisplay := true