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

Correctly handle null in Write/WriteLine

This commit is contained in:
disarray2077 2022-02-25 21:26:56 -03:00 committed by GitHub
parent 3dd4212ccd
commit 06bc73976f
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);
}