diff options
| author | Joyless <65855333+Joy-less@users.noreply.github.com> | 2024-08-12 16:44:09 +0100 |
|---|---|---|
| committer | Spartan322 <Megacake1234@gmail.com> | 2024-11-01 18:10:50 -0400 |
| commit | 6d320063717c02cab8b1eb81ccbbfe204946ced8 (patch) | |
| tree | 5602d2c4af8facc6336143278dd4707781dc173b | |
| parent | 4f572c0debe770bb9b89692a1b59a771ab743315 (diff) | |
| download | redot-engine-6d320063717c02cab8b1eb81ccbbfe204946ced8.tar.gz | |
Add NotNullWhenAttribute to IsInstanceValid
(cherry picked from commit 3d43e73181416747b63a46870e7b3d3e78e385af)
| -rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/GodotObjectExtensions.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/GodotObjectExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/GodotObjectExtensions.cs index 563a6abe9b..1fc6e54e09 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/GodotObjectExtensions.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/GodotObjectExtensions.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using Godot.NativeInterop; #nullable enable @@ -51,7 +52,7 @@ namespace Godot /// </summary> /// <param name="instance">The instance to check.</param> /// <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; } |
