Skip to content

Commit c5e198f

Browse files
authored
Merge pull request #118 from microsoft/bugfix/null-ref-exp
- fixes a null reference exception
2 parents 1226f97 + 39b5d44 commit c5e198f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ If you haven't built kiota locally, select the appropriate version from the [rel
7575
kiota.exe --openapi ../msgraph-sdk-powershell/openApiDocs/v1.0/mail.yml --language csharp -o ../somepath -n namespaceprefix
7676
```
7777
78-
> Note: once your SDK is generated in your target project, you will need to add references to kiota abstractions and kiota core in your project. Refer to [Initializing targed projects][#initializing-targed-projects]
78+
> Note: once your SDK is generated in your target project, you will need to add references to kiota abstractions and kiota core in your project. Refer to [Initializing targed projects](#initializing-targed-projects)
7979
8080
#### Parameters reference
8181

src/Kiota.Builder/Refiners/JavaRefiner.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ private void AddListImport(CodeElement currentElement) {
8484
};
8585
private void CorrectCoreType(CodeElement currentElement) {
8686
if (currentElement is CodeProperty currentProperty) {
87-
if(currentProperty.Type.Name?.Equals("IHttpCore", StringComparison.InvariantCultureIgnoreCase) ?? false)
87+
if("IHttpCore".Equals(currentProperty.Type.Name, StringComparison.InvariantCultureIgnoreCase))
8888
currentProperty.Type.Name = "HttpCore";
8989
else if(currentProperty.Name.Equals("serializerFactory", StringComparison.InvariantCultureIgnoreCase))
9090
currentProperty.Type.Name = "SerializationWriterFactory";
9191
else if(currentProperty.Name.Equals("deserializeFields", StringComparison.InvariantCultureIgnoreCase))
9292
currentProperty.Type.Name = $"Map<String, BiConsumer<T, ParseNode>>";
93-
else if(currentProperty.Type.Name.Equals("DateTimeOffset", StringComparison.InvariantCultureIgnoreCase)) {
93+
else if("DateTimeOffset".Equals(currentProperty.Type.Name, StringComparison.InvariantCultureIgnoreCase)) {
9494
currentProperty.Type.Name = $"OffsetDateTime";
9595
var nUsing = new CodeUsing(currentProperty.Parent) {
9696
Name = "java.time",

src/Kiota.Builder/Refiners/TypeScriptRefiner.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ private void AddParsableInheritanceForModelClasses(CodeElement currentElement) {
4444
};
4545
private void CorrectCoreType(CodeElement currentElement) {
4646
if (currentElement is CodeProperty currentProperty) {
47-
if (currentProperty.Type.Name?.Equals("IHttpCore", StringComparison.InvariantCultureIgnoreCase) ?? false)
47+
if ("IHttpCore".Equals(currentProperty.Type.Name, StringComparison.InvariantCultureIgnoreCase))
4848
currentProperty.Type.Name = "HttpCore";
4949
else if(currentProperty.Name.Equals("serializerFactory", StringComparison.InvariantCultureIgnoreCase))
5050
currentProperty.Type.Name = "SerializationWriterFactory";
5151
else if(currentProperty.Name.Equals("deserializeFields", StringComparison.InvariantCultureIgnoreCase))
5252
currentProperty.Type.Name = $"Map<string, (item: {currentProperty.Parent.Name.ToFirstCharacterUpperCase()}, node: ParseNode) => void>";
53-
else if(currentProperty.Type.Name.Equals("DateTimeOffset", StringComparison.InvariantCultureIgnoreCase))
53+
else if("DateTimeOffset".Equals(currentProperty.Type.Name, StringComparison.InvariantCultureIgnoreCase))
5454
currentProperty.Type.Name = $"Date";
5555
}
5656
if (currentElement is CodeMethod currentMethod) {

0 commit comments

Comments
 (0)