C#: Throw NullReferenceException for null NodePath/RID params
This commit is contained in:
parent
84761ca106
commit
008769aee9
2 changed files with 2 additions and 2 deletions
|
@ -12,7 +12,7 @@ namespace Godot
|
|||
internal static IntPtr GetPtr(NodePath instance)
|
||||
{
|
||||
if (instance == null)
|
||||
return IntPtr.Zero;
|
||||
throw new NullReferenceException($"The instance of type {nameof(NodePath)} is null.");
|
||||
|
||||
if (instance.disposed)
|
||||
throw new ObjectDisposedException(instance.GetType().FullName);
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Godot
|
|||
internal static IntPtr GetPtr(RID instance)
|
||||
{
|
||||
if (instance == null)
|
||||
return IntPtr.Zero;
|
||||
throw new NullReferenceException($"The instance of type {nameof(RID)} is null.");
|
||||
|
||||
if (instance.disposed)
|
||||
throw new ObjectDisposedException(instance.GetType().FullName);
|
||||
|
|
Loading…
Reference in a new issue