Skip to content

Commit

Permalink
Guard against potential null (#1695)
Browse files Browse the repository at this point in the history
  • Loading branch information
manodasanW authored Aug 2, 2024
1 parent 15af469 commit b1ecedd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/WinRT.Runtime/ComWrappersSupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,8 @@ internal static Type GetRuntimeClassForTypeCreation(IInspectable inspectable, Ty
// isn't already added. On JIT, we can construct it at runtime.
if (!RuntimeFeature.IsDynamicCodeCompiled)
{
if (implementationType.IsInterface &&
if (implementationType != null &&
implementationType.IsInterface &&
implementationType.IsGenericType &&
!TypedObjectFactoryCacheForType.ContainsKey(implementationType))
{
Expand Down

0 comments on commit b1ecedd

Please sign in to comment.