Merge pull request #33703 from neikeq/issue-32899

C#: Throw NullReferenceException for null NodePath/RID params
This commit is contained in:
Rémi Verschelde 2019-11-18 12:40:54 +01:00 committed by GitHub
commit ab81353155
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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);

View file

@ -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);