Skip to content

Commit 10ff614

Browse files
authored
Merge pull request #1385 from microsoft/fix1369
Fix NRE thrown from friendly overloads with optional pointer parameters
2 parents 7a3acf9 + 0aefb78 commit 10ff614

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.Windows.CsWin32/Generator.FriendlyOverloads.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,8 @@ private IEnumerable<MethodDeclarationSyntax> DeclareFriendlyOverloads(MethodDefi
607607
ArgumentList().AddArguments(Argument(LiteralExpression(SyntaxKind.NullLiteralExpression))));
608608
arguments[param.SequenceNumber - 1] = Argument(ConditionalExpression(
609609
MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, origName, IdentifierName("HasValue")),
610-
localName,
611-
nullRef));
610+
RefExpression(localName),
611+
RefExpression(nullRef)));
612612
}
613613

614614
bool TryHandleCountParam(TypeSyntax elementType, bool nullableSource)

0 commit comments

Comments
 (0)