File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Flow.Launcher.Core/Plugin Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1- using System ;
1+ using System ;
22using System . Collections . Generic ;
33using System . IO ;
44using System . Linq ;
@@ -53,17 +53,25 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
5353 Log . Exception ( $ "|PluginsLoader.DotNetPlugins|Couldn't load assembly for { metadata . Name } ", e ) ;
5454 return ;
5555 }
56- var types = assembly . GetTypes ( ) ;
56+
5757 Type type ;
5858 try
5959 {
60+ var types = assembly . GetTypes ( ) ;
61+
6062 type = types . First ( o => o . IsClass && ! o . IsAbstract && o . GetInterfaces ( ) . Contains ( typeof ( IPlugin ) ) ) ;
6163 }
6264 catch ( InvalidOperationException e )
6365 {
6466 Log . Exception ( $ "|PluginsLoader.DotNetPlugins|Can't find class implement IPlugin for <{ metadata . Name } >", e ) ;
6567 return ;
6668 }
69+ catch ( ReflectionTypeLoadException e )
70+ {
71+ Log . Exception ( $ "|PluginsLoader.DotNetPlugins|The GetTypes method was unable to load assembly types for <{ metadata . Name } >", e ) ;
72+ return ;
73+ }
74+
6775 IPlugin plugin ;
6876 try
6977 {
You can’t perform that action at this time.
0 commit comments