Skip to content

Commit b8526f2

Browse files
committed
check query for null (I don't know how this can happen)
1 parent 792b383 commit b8526f2

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,18 @@ public static async Task InitializePluginsAsync(IPublicAPI api)
166166

167167
public static ICollection<PluginPair> ValidPluginsForQuery(Query query)
168168
{
169-
if (NonGlobalPlugins.ContainsKey(query.ActionKeyword))
170-
{
171-
var plugin = NonGlobalPlugins[query.ActionKeyword];
172-
return new List<PluginPair>
173-
{
174-
plugin
175-
};
176-
}
177-
else
178-
{
169+
if (query is null)
170+
return Array.Empty<PluginPair>();
171+
172+
if (!NonGlobalPlugins.ContainsKey(query.ActionKeyword))
179173
return GlobalPlugins;
180-
}
174+
175+
176+
var plugin = NonGlobalPlugins[query.ActionKeyword];
177+
return new List<PluginPair>
178+
{
179+
plugin
180+
};
181181
}
182182

183183
public static async Task<List<Result>> QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token)

0 commit comments

Comments
 (0)