Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd86bf3c

Browse files
authored
ParameterInfo.Name needs to be checked for null before usage (#1375)
This occured in trying to use F# code from Python. As the `.Name` propertyreturns `null`, `ContainsKey` fails.Related documentation:https://docs.microsoft.com/en-us/dotnet/api/system.reflection.parameterinfo.name
1 parent1afae4c commitd86bf3c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

‎CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ or the DLL must be loaded in advance. This must be done before calling any other
5656
-`import` may now raise errors with more detail than "No module named X"
5757
- Exception stacktraces on`PythonException.StackTrace` are now properly formatted
5858
- Providing an invalid type parameter to a generic type or method produces a helpful Python error
59+
- Empty parameter names (as can be generated from F#) do not cause crashes
5960

6061
###Removed
6162

‎src/runtime/methodbinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ static object[] TryConvertArguments(ParameterInfo[] pi, bool paramsArray,
622622
for(intparamIndex=0;paramIndex<pi.Length;paramIndex++)
623623
{
624624
varparameter=pi[paramIndex];
625-
boolhasNamedParam=kwargDict.ContainsKey(parameter.Name);
625+
boolhasNamedParam=parameter.Name!=null?kwargDict.ContainsKey(parameter.Name):false;
626626
boolisNewReference=false;
627627

628628
if(paramIndex>=pyArgCount&&!(hasNamedParam||(paramsArray&&paramIndex==arrayStart)))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp