Skip to content

Commit

Permalink
chore: add variants null check
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonHough committed Jan 9, 2024
1 parent f18fa72 commit 53e29a0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Editor/Core/Scripts/Settings/GraphicsSettingsUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ public static void AddPreloadShaderVariants(bool checkForMissingVariants = false

var newArrayIndex = shaderPreloadArray.arraySize;
var shaderVariants = AssetDatabase.LoadAssetAtPath<ShaderVariantCollection>(GetTargetShaderPath());
if (shaderVariants == null)
{
Debug.LogWarning($"Shader variants not found at {GetTargetShaderPath()}");
return;
}
if (checkForMissingVariants)
{
var shadersMissing = true;
Expand Down

0 comments on commit 53e29a0

Please sign in to comment.