Skip to content

Commit

Permalink
Fix ext. tools failing with a [{Required,Optional}Api] ApiContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
YoshiRulz committed Sep 17, 2024
1 parent 55762bf commit 4b454a6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/BizHawk.Client.Common/Api/BasicApiProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ public class BasicApiProvider : IExternalApiProvider

public BasicApiProvider(ApiContainer apiContainer) => Container = apiContainer;

public object? GetApi(Type t) => Container.Libraries.TryGetValue(t, out var api) ? api : null;
public object? GetApi(Type t)
=> Container.Libraries.TryGetValue(t, out var api)
? api
: t == typeof(ApiContainer)
? Container
: null;

public bool HasApi(Type t) => Container.Libraries.ContainsKey(t);
}
Expand Down

0 comments on commit 4b454a6

Please sign in to comment.