Skip to content

Commit

Permalink
Ensure Dequeue is not attempted if buffer size is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-f-cruz committed Jul 3, 2024
1 parent 82448b9 commit 946e447
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Bonsai.Design/ObjectTextVisualizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected override void ShowBuffer(IList<Timestamped<object>> 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)
Expand Down

0 comments on commit 946e447

Please sign in to comment.