mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 06:14:10 +02:00
ToString protection against null type
This commit is contained in:
parent
3f4988cbd5
commit
da9e9120c0
1 changed files with 17 additions and 10 deletions
|
@ -144,6 +144,12 @@ namespace System
|
|||
NumberFormatter.AddrToString((uint)Internal.UnsafeCastToPtr(this), strBuffer);
|
||||
#else
|
||||
let t = RawGetType();
|
||||
if (t == null)
|
||||
{
|
||||
strBuffer.AppendF($"Type#{(Int.Simple)GetTypeId()}");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (t.IsBoxedStructPtr)
|
||||
{
|
||||
let ti = (TypeInstance)t;
|
||||
|
@ -156,6 +162,7 @@ namespace System
|
|||
return;
|
||||
}
|
||||
t.GetFullName(strBuffer);
|
||||
}
|
||||
strBuffer.Append("@0x");
|
||||
NumberFormatter.AddrToString((uint)Internal.UnsafeCastToPtr(this), strBuffer);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue