Skip to content

Commit

Permalink
adds nullable checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Omondi committed Oct 1, 2024
1 parent 329c3e8 commit 8580374
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Kiota.Builder/KiotaBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -955,10 +955,10 @@ x.Parent is CodeIndexer ||

Parallel.ForEach(unmappedRequestBuilderTypes, parallelOptions, x =>
{
var parentClass = x.Parent?.Parent as CodeClass;
var parentNS = x.Parent?.Parent?.Parent as CodeNamespace;
CodeClass[] exceptions = x.Parent?.Parent is CodeClass parentClass ? [parentClass] : [];
x.TypeDefinition = parentNS?.FindChildrenByName<CodeClass>(x.Name)
.Except([parentClass]).OfType<CodeClass>() // the property method should not reference itself as a return type.
.Except(exceptions)// the property method should not reference itself as a return type.
.MinBy(shortestNamespaceOrder);
// searching down first because most request builder properties on a request builder are just sub paths on the API
if (x.TypeDefinition == null)
Expand Down

0 comments on commit 8580374

Please sign in to comment.