From 946e447020560d1d536f9e096c7220819d2deb93 Mon Sep 17 00:00:00 2001 From: bruno-f-cruz <7049351+bruno-f-cruz@users.noreply.github.com> Date: Wed, 3 Jul 2024 13:57:09 -0700 Subject: [PATCH] Ensure Dequeue is not attempted if buffer size is 0 --- Bonsai.Design/ObjectTextVisualizer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bonsai.Design/ObjectTextVisualizer.cs b/Bonsai.Design/ObjectTextVisualizer.cs index 9032dee5..30f30401 100644 --- a/Bonsai.Design/ObjectTextVisualizer.cs +++ b/Bonsai.Design/ObjectTextVisualizer.cs @@ -37,7 +37,7 @@ protected override void ShowBuffer(IList> values) var sb = new StringBuilder(); // Trim old values if bufferSize was reduced - while (buffer.Count >= bufferSize) + while ((buffer.Count >= bufferSize) & (buffer.Count > 0)) buffer.Dequeue(); // Add new values to the buffer (and only the ones which might appear)