@@ -10,6 +10,9 @@ internal static partial class RenderPipelineGraphicsSettingsStripper
10
10
{
11
11
private static bool CanRemoveSettings ( this List < IStripper > strippers , [ DisallowNull ] Type settingsType , [ DisallowNull ] IRenderPipelineGraphicsSettings settings )
12
12
{
13
+ if ( strippers == null )
14
+ return false ;
15
+
13
16
const BindingFlags flags = BindingFlags . Public | BindingFlags . NonPublic | BindingFlags . Instance ;
14
17
15
18
var canRemoveSettings = true ;
@@ -18,7 +21,7 @@ private static bool CanRemoveSettings(this List<IStripper> strippers, [DisallowN
18
21
19
22
foreach ( var stripperInstance in strippers )
20
23
{
21
- var methodInfo = stripperInstance . GetType ( ) . GetMethod ( $ "{ nameof ( IRenderPipelineGraphicsSettingsStripper < IRenderPipelineGraphicsSettings > . CanRemoveSettings ) } ", flags ) ;
24
+ var methodInfo = stripperInstance ? . GetType ( ) . GetMethod ( $ "{ nameof ( IRenderPipelineGraphicsSettingsStripper < IRenderPipelineGraphicsSettings > . CanRemoveSettings ) } ", flags ) ;
22
25
if ( methodInfo != null )
23
26
canRemoveSettings &= ( bool ) methodInfo . Invoke ( stripperInstance , methodArgs ) ;
24
27
}
@@ -36,8 +39,7 @@ private static bool CanTransferSettingsToPlayer(
36
39
strippersDefined = false ;
37
40
38
41
var settingsType = settings . GetType ( ) ;
39
-
40
- if ( strippersMap . TryGetValue ( settingsType , out var strippers ) )
42
+ if ( strippersMap . TryGetValue ( settingsType , out var strippers ) && strippers != null )
41
43
{
42
44
if ( ! strippers . CanRemoveSettings ( settingsType , settings ) )
43
45
isAvailableOnPlayerBuild = true ;
@@ -80,7 +82,7 @@ public static void PerformStripping(
80
82
report . AddStrippedSetting ( settings . GetType ( ) , isAvailableOnPlayerBuild , strippersDefined ) ;
81
83
}
82
84
}
83
-
85
+
84
86
}
85
87
}
86
88
}
0 commit comments