From eb6f456fe8070e0432ee3155aec01463ab4e84e3 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Sun, 28 Nov 2021 04:40:50 +0700 Subject: [PATCH] Fix `none` spam in `ConsoleBuffer` --- sources/Console/ConsoleBuffer.uc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/Console/ConsoleBuffer.uc b/sources/Console/ConsoleBuffer.uc index 153ef6d..09b74bf 100644 --- a/sources/Console/ConsoleBuffer.uc +++ b/sources/Console/ConsoleBuffer.uc @@ -173,7 +173,7 @@ public final function ConsoleBuffer Clear() * at the end of the `input` if you want that. * * @param input `Text` to be added to the current line in caller - * `ConsoleBuffer`. + * `ConsoleBuffer`. Does nothing if passed `none`. * @param inputType How to treat given `string` regarding coloring. * @return Returns caller `ConsoleBuffer` to allow method chaining. */ @@ -181,6 +181,9 @@ public final function ConsoleBuffer Insert(Text input) { local int inputConsumed; local Text.Character nextCharacter; + if (input == none) { + return self; + } // Regular symbols and whitespaces are treated differently when // breaking input into lines, so alternate between adding them, // switching the logic appropriately