|
@@ -93,9 +93,20 @@ namespace BepInEx.Bootstrap
|
|
|
|
|
|
public static PluginInfo ToPluginInfo(TypeDefinition type)
|
|
|
{
|
|
|
- if (type.IsInterface || type.IsAbstract || !type.IsSubtypeOf(typeof(BaseUnityPlugin)))
|
|
|
+ if (type.IsInterface || type.IsAbstract)
|
|
|
return null;
|
|
|
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (!type.IsSubtypeOf(typeof(BaseUnityPlugin)))
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ catch (AssemblyResolutionException)
|
|
|
+ {
|
|
|
+ // Can happen if this type inherits a type from an assembly that can't be found. Safe to assume it's not a plugin.
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
var metadata = BepInPlugin.FromCecilType(type);
|
|
|
|
|
|
// Perform checks that will prevent the plugin from being loaded in ALL cases
|