8000 ParameterInfo.Name needs to be checked for null before usage by filmor · Pull Request #1375 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

ParameterInfo.Name needs to be checked for null before usage #1375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ or the DLL must be loaded in advance. This must be done before calling any other
- `import` may now raise errors with more detail than "No module named X"
- Exception stacktraces on `PythonException.StackTrace` are now properly formatted
- Providing an invalid type parameter to a generic type or method produces a helpful Python error
- Empty parameter names (as can be generated from F#) do not cause crashes

### Removed

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/methodbinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ static object[] TryConvertArguments(ParameterInfo[] pi, bool paramsArray,
for (int paramIndex = 0; paramIndex < pi.Length; paramIndex++)
{
var parameter = pi[paramIndex];
bool hasNamedParam = kwargDict.ContainsKey(parameter.Name);
bool hasNamedParam = parameter.Name != null ? kwargDict.ContainsKey(parameter.Name) : false;
bool isNewReference = false;

if (paramIndex >= pyArgCount && !(hasNamedParam || (paramsArray && paramIndex == arrayStart)))
Expand Down
0