@@ -10,6 +10,9 @@ internal static partial class RenderPipelineGraphicsSettingsStripper
1010 {
1111 private static bool CanRemoveSettings ( this List < IStripper > strippers , [ DisallowNull ] Type settingsType , [ DisallowNull ] IRenderPipelineGraphicsSettings settings )
1212 {
13+ if ( strippers == null )
14+ return false ;
15+
1316 const BindingFlags flags = BindingFlags . Public | BindingFlags . NonPublic | BindingFlags . Instance ;
1417
1518 var canRemoveSettings = true ;
@@ -18,7 +21,7 @@ private static bool CanRemoveSettings(this List<IStripper> strippers, [DisallowN
1821
1922 foreach ( var stripperInstance in strippers )
2023 {
21- var methodInfo = stripperInstance . GetType ( ) . GetMethod ( $ "{ nameof ( IRenderPipelineGraphicsSettingsStripper < IRenderPipelineGraphicsSettings > . CanRemoveSettings ) } ", flags ) ;
24+ var methodInfo = stripperInstance ? . GetType ( ) . GetMethod ( $ "{ nameof ( IRenderPipelineGraphicsSettingsStripper < IRenderPipelineGraphicsSettings > . CanRemoveSettings ) } ", flags ) ;
2225 if ( methodInfo != null )
2326 canRemoveSettings &= ( bool ) methodInfo . Invoke ( stripperInstance , methodArgs ) ;
2427 }
@@ -36,8 +39,7 @@ private static bool CanTransferSettingsToPlayer(
3639 strippersDefined = false ;
3740
3841 var settingsType = settings . GetType ( ) ;
39-
40- if ( strippersMap . TryGetValue ( settingsType , out var strippers ) )
42+ if ( strippersMap . TryGetValue ( settingsType , out var strippers ) && strippers != null )
4143 {
4244 if ( ! strippers . CanRemoveSettings ( settingsType , settings ) )
4345 isAvailableOnPlayerBuild = true ;
@@ -80,7 +82,7 @@ public static void PerformStripping(
8082 report . AddStrippedSetting ( settings . GetType ( ) , isAvailableOnPlayerBuild , strippersDefined ) ;
8183 }
8284 }
83-
85+
8486 }
8587 }
8688}
0 commit comments