mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-20 17:08:00 +02:00
Merge pull request #1471 from disarray2077/patch-3
Correctly handle null in `Write`/`WriteLine`
This commit is contained in:
commit
7a227ee7a4
1 changed files with 8 additions and 2 deletions
|
@ -221,7 +221,10 @@ namespace System
|
||||||
public static void Write(Object obj)
|
public static void Write(Object obj)
|
||||||
{
|
{
|
||||||
String str = scope String(256);
|
String str = scope String(256);
|
||||||
obj.ToString(str);
|
if (obj == null)
|
||||||
|
str.Append("null");
|
||||||
|
else
|
||||||
|
obj.ToString(str);
|
||||||
Write(str);
|
Write(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +248,10 @@ namespace System
|
||||||
public static void WriteLine(Object obj)
|
public static void WriteLine(Object obj)
|
||||||
{
|
{
|
||||||
String str = scope String(256);
|
String str = scope String(256);
|
||||||
obj.ToString(str);
|
if (obj == null)
|
||||||
|
str.Append("null");
|
||||||
|
else
|
||||||
|
obj.ToString(str);
|
||||||
WriteLine(str);
|
WriteLine(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue