Skip to content

Commit 4b454a6

Browse files
committed
Fix ext. tools failing with a [{Required,Optional}Api] ApiContainer
1 parent 55762bf commit 4b454a6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/BizHawk.Client.Common/Api/BasicApiProvider.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ public class BasicApiProvider : IExternalApiProvider
1313

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

16-
public object? GetApi(Type t) => Container.Libraries.TryGetValue(t, out var api) ? api : null;
16+
public object? GetApi(Type t)
17+
=> Container.Libraries.TryGetValue(t, out var api)
18+
? api
19+
: t == typeof(ApiContainer)
20+
? Container
21+
: null;
1722

1823
public bool HasApi(Type t) => Container.Libraries.ContainsKey(t);
1924
}

0 commit comments

Comments
 (0)