From bed0950614f6ac9f2ef5278bfd01e1c7382b83ae Mon Sep 17 00:00:00 2001 From: Ivan Shvedov Date: Mon, 28 May 2018 12:37:13 +0300 Subject: [PATCH 1/2] Fix infinite loop in Append(object value) --- source/System/Text/StringBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/System/Text/StringBuilder.cs b/source/System/Text/StringBuilder.cs index 0bb53282..4f2fa32f 100644 --- a/source/System/Text/StringBuilder.cs +++ b/source/System/Text/StringBuilder.cs @@ -364,7 +364,7 @@ public StringBuilder Append(long value) /// A reference to this instance after the append operation has completed. public StringBuilder Append(object value) { - return value == null ? this : Append(value); + return Append(value.ToString()); } /// From 1da2be5ff096303cf51417c635450e146aad3e7d Mon Sep 17 00:00:00 2001 From: Ivan Shvedov Date: Mon, 28 May 2018 14:05:19 +0300 Subject: [PATCH 2/2] Return null check. --- source/System/Text/StringBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/System/Text/StringBuilder.cs b/source/System/Text/StringBuilder.cs index 4f2fa32f..2b8a85ea 100644 --- a/source/System/Text/StringBuilder.cs +++ b/source/System/Text/StringBuilder.cs @@ -364,7 +364,7 @@ public StringBuilder Append(long value) /// A reference to this instance after the append operation has completed. public StringBuilder Append(object value) { - return Append(value.ToString()); + return value == null ? this : Append(value.ToString()); } ///