Browse Source

Improve SRE check

ghorsington 5 years ago
parent
commit
212b8aabf6
1 changed files with 6 additions and 1 deletions
  1. 6 1
      BepInEx/Utility.cs

+ 6 - 1
BepInEx/Utility.cs

@@ -22,13 +22,18 @@ namespace BepInEx
 		{
 		{
 			try
 			try
 			{
 			{
-				var m = new DynamicMethod("SRE_Test", null, null);
 				CLRSupportsDynamicAssemblies = true;
 				CLRSupportsDynamicAssemblies = true;
+				// ReSharper disable once AssignNullToNotNullAttribute
+				var m = new CustomAttributeBuilder(null, new object[0]);
 			}
 			}
 			catch (PlatformNotSupportedException)
 			catch (PlatformNotSupportedException)
 			{
 			{
 				CLRSupportsDynamicAssemblies = false;
 				CLRSupportsDynamicAssemblies = false;
 			}
 			}
+			catch (ArgumentNullException)
+			{
+				// Suppress ArgumentNullException
+			}
 		}
 		}
 
 
 		/// <summary>
 		/// <summary>