diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs index 86b97ff8529..7dfd89564e7 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs @@ -717,10 +717,10 @@ public void SetDataOnSubTarget(SubTarget subTarget) where T : JsonObject T data = null; foreach (var x in m_Datas.SelectValue()) { - if (x.GetType().Equals(typeof(T))) + if (x is T y) { - data = x as T; - continue; + data = y; + break; } }