diff --git a/src/ComputeSharp.Core/Attributes/ShaderMethodSourceAttribute.cs b/src/ComputeSharp.Core/Attributes/ShaderMethodSourceAttribute.cs index 9fd1fbd1..236d9f78 100644 --- a/src/ComputeSharp.Core/Attributes/ShaderMethodSourceAttribute.cs +++ b/src/ComputeSharp.Core/Attributes/ShaderMethodSourceAttribute.cs @@ -81,7 +81,7 @@ namespace ComputeSharp { Guard.IsTrue(function.Method.IsStatic, "Captured delegates need to wrap static methods"); - var attributes = function.Method.DeclaringType.Assembly.GetCustomAttributes(); + var attributes = function.Method.DeclaringType!.Assembly.GetCustomAttributes(); string methodName = function.Method.GetFullName(); foreach (var attribute in attributes)