You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
C#: Throw NullReferenceException for null NodePath/RID params
This commit is contained in:
@@ -12,7 +12,7 @@ namespace Godot
|
|||||||
internal static IntPtr GetPtr(NodePath instance)
|
internal static IntPtr GetPtr(NodePath instance)
|
||||||
{
|
{
|
||||||
if (instance == null)
|
if (instance == null)
|
||||||
return IntPtr.Zero;
|
throw new NullReferenceException($"The instance of type {nameof(NodePath)} is null.");
|
||||||
|
|
||||||
if (instance.disposed)
|
if (instance.disposed)
|
||||||
throw new ObjectDisposedException(instance.GetType().FullName);
|
throw new ObjectDisposedException(instance.GetType().FullName);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Godot
|
|||||||
internal static IntPtr GetPtr(RID instance)
|
internal static IntPtr GetPtr(RID instance)
|
||||||
{
|
{
|
||||||
if (instance == null)
|
if (instance == null)
|
||||||
return IntPtr.Zero;
|
throw new NullReferenceException($"The instance of type {nameof(RID)} is null.");
|
||||||
|
|
||||||
if (instance.disposed)
|
if (instance.disposed)
|
||||||
throw new ObjectDisposedException(instance.GetType().FullName);
|
throw new ObjectDisposedException(instance.GetType().FullName);
|
||||||
|
|||||||
Reference in New Issue
Block a user