1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-20 00:50:25 +02:00

Merge pull request #1471 from disarray2077/patch-3

Correctly handle null in `Write`/`WriteLine`
This commit is contained in:
Brian Fiete 2022-03-01 18:54:21 +01:00 committed by GitHub
commit 7a227ee7a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -221,7 +221,10 @@ namespace System
public static void Write(Object obj)
{
String str = scope String(256);
obj.ToString(str);
if (obj == null)
str.Append("null");
else
obj.ToString(str);
Write(str);
}
@ -245,7 +248,10 @@ namespace System
public static void WriteLine(Object obj)
{
String str = scope String(256);
obj.ToString(str);
if (obj == null)
str.Append("null");
else
obj.ToString(str);
WriteLine(str);
}