mirror of https://github.com/godotengine/godot
Add NotNullWhenAttribute to IsInstanceValid
This commit is contained in:
parent
86c95d26fc
commit
3d43e73181
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Godot.NativeInterop;
|
using Godot.NativeInterop;
|
||||||
|
|
||||||
#nullable enable
|
#nullable enable
|
||||||
|
|
@ -51,7 +52,7 @@ namespace Godot
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="instance">The instance to check.</param>
|
/// <param name="instance">The instance to check.</param>
|
||||||
/// <returns>If the instance is a valid object.</returns>
|
/// <returns>If the instance is a valid object.</returns>
|
||||||
public static bool IsInstanceValid(GodotObject? instance)
|
public static bool IsInstanceValid([NotNullWhen(true)] GodotObject? instance)
|
||||||
{
|
{
|
||||||
return instance != null && instance.NativeInstance != IntPtr.Zero;
|
return instance != null && instance.NativeInstance != IntPtr.Zero;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue