diff --git a/packages/vsce/src/trees/CICSCombinedLocalFileTree.ts b/packages/vsce/src/trees/CICSCombinedLocalFileTree.ts index 12f4bfbc..27dcebef 100644 --- a/packages/vsce/src/trees/CICSCombinedLocalFileTree.ts +++ b/packages/vsce/src/trees/CICSCombinedLocalFileTree.ts @@ -111,6 +111,7 @@ export class CICSCombinedLocalFileTree extends TreeItem { public addLocalFilesUtil(newChildren: (CICSLocalFileTreeItem | ViewMore)[], allLocalFiles: any, count: number | undefined) { for (const localfile of allLocalFiles) { const regionsContainer = this.parentPlex.children.filter((child) => child instanceof CICSRegionsContainer)?.[0]; + if (regionsContainer == null) { continue; } const parentRegion = regionsContainer .getChildren() .filter((child) => child instanceof CICSRegionTree && child.getRegionName() === localfile.eyu_cicsname)?.[0]; diff --git a/packages/vsce/src/trees/CICSCombinedProgramTree.ts b/packages/vsce/src/trees/CICSCombinedProgramTree.ts index bf8adc04..991726a0 100644 --- a/packages/vsce/src/trees/CICSCombinedProgramTree.ts +++ b/packages/vsce/src/trees/CICSCombinedProgramTree.ts @@ -113,6 +113,7 @@ export class CICSCombinedProgramTree extends TreeItem { for (const program of allPrograms) { // Regions container must exist if all programs tree exists const regionsContainer = this.parentPlex.children.filter((child) => child instanceof CICSRegionsContainer)?.[0]; + if (regionsContainer == null) { continue; } const parentRegion = regionsContainer .getChildren() .filter((child) => child instanceof CICSRegionTree && child.getRegionName() === program.eyu_cicsname)?.[0]; diff --git a/packages/vsce/src/trees/CICSCombinedTransactionTree.ts b/packages/vsce/src/trees/CICSCombinedTransactionTree.ts index 273fd04a..d14ce5b3 100644 --- a/packages/vsce/src/trees/CICSCombinedTransactionTree.ts +++ b/packages/vsce/src/trees/CICSCombinedTransactionTree.ts @@ -112,6 +112,7 @@ export class CICSCombinedTransactionsTree extends TreeItem { public addLocalTransactionsUtil(newChildren: (CICSTransactionTreeItem | ViewMore)[], allLocalTransactions: any, count: number | undefined) { for (const transaction of allLocalTransactions) { const regionsContainer = this.parentPlex.children.filter((child) => child instanceof CICSRegionsContainer)?.[0]; + if (regionsContainer == null) { continue; } const parentRegion = regionsContainer .getChildren() .filter((child) => child instanceof CICSRegionTree && child.getRegionName() === transaction.eyu_cicsname)?.[0]; diff --git a/packages/vsce/src/utils/webviewHTML.ts b/packages/vsce/src/utils/webviewHTML.ts index 4409784b..059f4c0c 100644 --- a/packages/vsce/src/utils/webviewHTML.ts +++ b/packages/vsce/src/utils/webviewHTML.ts @@ -124,10 +124,10 @@ export const addProfileHtml = (message?: IUpdateProfile) => {
@@ -157,7 +157,7 @@ export const addProfileHtml = (message?: IUpdateProfile) => { class="bx--text-input" placeholder="example.cics.host.com" oninput="handleHostInputName()" - ${message?.profile.host ? `value =${message.profile.host}` : undefined} + ${message?.profile?.host ? `value =${message.profile.host}` : undefined} />
@@ -170,7 +170,7 @@ export const addProfileHtml = (message?: IUpdateProfile) => { type="text" class="bx--text-input" placeholder="12345" - ${message?.profile.port ? `value =${message.profile.port}` : undefined} + ${message?.profile?.port ? `value =${message.profile.port}` : undefined} /> @@ -187,7 +187,7 @@ export const addProfileHtml = (message?: IUpdateProfile) => {
@@ -251,7 +251,7 @@ export const addProfileHtml = (message?: IUpdateProfile) => { type="password" class="bx--text-input" placeholder="" - ${message?.profile.password ? `value =${message.profile.password}` : undefined} + ${message?.profile?.password ? `value =${message.profile.password}` : undefined} />
@@ -269,7 +269,7 @@ export const addProfileHtml = (message?: IUpdateProfile) => { type="text" class="bx--text-input" placeholder="" - ${message?.profile.regionName ? `value =${message.profile.regionName}` : undefined} + ${message?.profile?.regionName ? `value =${message.profile.regionName}` : undefined} /> @@ -282,7 +282,7 @@ export const addProfileHtml = (message?: IUpdateProfile) => { type="text" class="bx--text-input" placeholder="" - ${message?.profile.cicsPlex ? `value =${message.profile.cicsPlex}` : undefined} + ${message?.profile?.cicsPlex ? `value =${message.profile.cicsPlex}` : undefined} /> @@ -331,9 +331,9 @@ export const addProfileHtml = (message?: IUpdateProfile) => { } function onLoadRenderRU() { - if (${message?.profile.protocol === "https"}) { + if (${message?.profile?.protocol === "https"}) { setContentsEnabled("ru-selection-container"); - } else if (${message?.profile.protocol === "http"}) { + } else if (${message?.profile?.protocol === "http"}) { setContentsDisabled("ru-selection-container"); } }