Skip to content

Commit 9c177fb

Browse files
committed
ProxyProvidedTypeWithContext: null-safe GetClrName
1 parent 0ef51d0 commit 9c177fb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ReSharper.FSharp/src/FSharp/FSharp.TypeProviders.Protocol/src/Models/ProxyProvidedTypeWithContext.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ public override bool Equals(object y) =>
188188
public IClrTypeName GetClrName() => myClrTypeName ??= ProxyProvidedType switch
189189
{
190190
IProxyProvidedType { IsCreatedByProvider: true } =>
191-
new ClrTypeName(Context.TryGetILTypeRef(this).Value.BasicQualifiedName),
191+
Context.TryGetILTypeRef(this) is { Value: { } ilTypeRef }
192+
? new ClrTypeName(ilTypeRef.BasicQualifiedName)
193+
: EmptyClrTypeName.Instance,
194+
192195
IProxyProvidedType type => type.GetClrName()
193196
};
194197

0 commit comments

Comments
 (0)