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 ;
2
2
using System . Collections . Generic ;
3
3
using System . IO ;
4
4
using System . Linq ;
@@ -53,17 +53,25 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
53
53
Log . Exception ( $ "|PluginsLoader.DotNetPlugins|Couldn't load assembly for { metadata . Name } ", e ) ;
54
54
return ;
55
55
}
56
- var types = assembly . GetTypes ( ) ;
56
+
57
57
Type type ;
58
58
try
59
59
{
60
+ var types = assembly . GetTypes ( ) ;
61
+
60
62
type = types . First ( o => o . IsClass && ! o . IsAbstract && o . GetInterfaces ( ) . Contains ( typeof ( IPlugin ) ) ) ;
61
63
}
62
64
catch ( InvalidOperationException e )
63
65
{
64
66
Log . Exception ( $ "|PluginsLoader.DotNetPlugins|Can't find class implement IPlugin for <{ metadata . Name } >", e ) ;
65
67
return ;
66
68
}
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
+
67
75
IPlugin plugin ;
68
76
try
69
77
{
You can’t perform that action at this time.
0 commit comments