File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
- using Flow . Launcher . Core . ExternalPlugins ;
1
+ using Flow . Launcher . Core . ExternalPlugins ;
2
2
using System ;
3
3
using System . Collections . Concurrent ;
4
4
using System . Collections . Generic ;
@@ -308,7 +308,8 @@ public static PluginPair GetPluginForId(string id)
308
308
309
309
public static IEnumerable < PluginPair > GetPluginsForInterface < T > ( ) where T : IFeatures
310
310
{
311
- return AllPlugins . Where ( p => p . Plugin is T ) ;
311
+ // Handle scenario where this is called before all plugins are instantiated, e.g. language change on startup
312
+ return AllPlugins ? . Where ( p => p . Plugin is T ) ?? Array . Empty < PluginPair > ( ) ;
312
313
}
313
314
314
315
public static List < Result > GetContextMenusForPlugin ( Result result )
Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ internal void AddPluginLanguageDirectories(IEnumerable<PluginPair> plugins)
58
58
59
59
private void LoadDefaultLanguage ( )
60
60
{
61
+ // Removes language files loaded before any plugins were loaded.
62
+ // Prevents the language Flow started in from overwriting English if the user switches back to English
63
+ RemoveOldLanguageFiles ( ) ;
61
64
LoadLanguage ( AvailableLanguages . English ) ;
62
65
_oldResources . Clear ( ) ;
63
66
}
You can’t perform that action at this time.
0 commit comments