Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Commit

Permalink
Add null check for schema and operation group for special case (#87)
Browse files Browse the repository at this point in the history
Co-authored-by: xichen <[email protected]>
  • Loading branch information
shawncx and msxichen authored Jul 29, 2020
1 parent 3d98a22 commit 41818df
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,9 @@ export class Helper {
public static enumrateSchemas(schemas: ObjectSchema[], action: (nodeDescriptor: CliCommonSchema.CodeModel.NodeDescriptor) => void, flag: CliCommonSchema.CodeModel.NodeTypeFlag): void {
const enumObjectSchema = isNullOrUndefined(flag) || ((flag & CliCommonSchema.CodeModel.NodeTypeFlag.objectSchema) > 0);
const cliKeyMissing = '<clikey-missing>';
if (isNullOrUndefined(schemas)) {
return;
}

for (let i = schemas.length - 1; i >= 0; i--) {
const schema = schemas[i];
Expand Down Expand Up @@ -477,6 +480,9 @@ export class Helper {
public static enumrateOperationGroups(groups: OperationGroup[], action: (nodeDescriptor: CliCommonSchema.CodeModel.NodeDescriptor) => void, flag: CliCommonSchema.CodeModel.NodeTypeFlag): void {
const enumGroup = isNullOrUndefined(flag) || ((flag & CliCommonSchema.CodeModel.NodeTypeFlag.operationGroup) > 0);
const cliKeyMissing = '<clikey-missing>';
if (isNullOrUndefined(groups)) {
return;
}

for (let i = groups.length - 1; i >= 0; i--) {
const group = groups[i];
Expand Down

0 comments on commit 41818df

Please sign in to comment.