| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -786,7 +786,7 @@ public static void InvokeCtor(IPythonDerivedType obj, string origCtorName, Objec | |||
| 786 | 786 | PyObject[] pyargs = new PyObject[args.Length]; | |
| 787 | 787 | for (int i = 0; i < args.Length; ++i) | |
| 788 | 788 | { | |
| 789 | - pyargs[i] = new PyObject(Converter.ToPython(args[i], args[i].GetType())); | ||
| 789 | + pyargs[i] = new PyObject(Converter.ToPython(args[i], args[i]?.GetType())); | ||
| 790 | 790 | disposeList.Add(pyargs[i]); | |
| 791 | 791 | } | |
| 792 | 792 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -228,7 +228,7 @@ internal static IntPtr ToPython(Object value, Type type) | |||
| 228 | 228 | { | |
| 229 | 229 | foreach (object o in (IEnumerable)value) | |
| 230 | 230 | { | |
| 231 | - using (var p = new PyObject(ToPython(o, o.GetType()))) | ||
| 231 | + using (var p = new PyObject(ToPython(o, o?.GetType()))) | ||
| 232 | 232 | resultlist.Append(p); | |
| 233 | 233 | } | |
| 234 | 234 | Runtime.Incref(resultlist.Handle); | |
@@ -962,7 +962,7 @@ public static class ConverterExtension | |||
| 962 | 962 | { | |
| 963 | 963 | public static PyObject ToPython(this object o) | |
| 964 | 964 | { | |
| 965 | - return new PyObject(Converter.ToPython(o, o.GetType())); | ||
| 965 | + return new PyObject(Converter.ToPython(o, o?.GetType())); | ||
| 966 | 966 | } | |
| 967 | 967 | } | |
| 968 | 968 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -972,7 +972,7 @@ private void GetArgs(object[] inargs, out PyTuple args, out PyDict kwargs) | |||
| 972 | 972 | } | |
| 973 | 973 | else | |
| 974 | 974 | { | |
| 975 | - ptr = Converter.ToPython(inargs[i], inargs[i].GetType()); | ||
| 975 | + ptr = Converter.ToPython(inargs[i], inargs[i]?.GetType()); | ||
| 976 | 976 | } | |
| 977 | 977 | if (Runtime.PyTuple_SetItem(argtuple, i, ptr) < 0) | |
| 978 | 978 | throw new PythonException(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -487,7 +487,7 @@ public static KeywordArguments kw(params object[] kv) | |||
| 487 | 487 | if (kv[i + 1] is PyObject) | |
| 488 | 488 | value = ((PyObject)kv[i + 1]).Handle; | |
| 489 | 489 | else | |
| 490 | - value = Converter.ToPython(kv[i + 1], kv[i + 1].GetType()); | ||
| 490 | + value = Converter.ToPython(kv[i + 1], kv[i + 1]?.GetType()); | ||
| 491 | 491 | if (Runtime.PyDict_SetItemString(dict.Handle, (string)kv[i], value) != 0) | |
| 492 | 492 | throw new ArgumentException(string.Format("Cannot add key '{0}' to dictionary.", (string)kv[i])); | |
| 493 | 493 | if (!(kv[i + 1] is PyObject)) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments