Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle getCache returning non-array #199

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/vsce/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to the "cics-extension-for-zowe" extension will be documente
## Recent Changes

- BugFix: Remove create profile gif from readme. [#33](https://github.com/zowe/cics-for-zowe-client/issues/33)
- BugFix: Handle getCache returning non-array. [#178](https://github.com/zowe/cics-for-zowe-client/issues/178)

## `3.2.4`

Expand Down
2 changes: 1 addition & 1 deletion packages/vsce/src/utils/commandUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ export function splitCmciErrorMessage(message: any) {
return [resp, resp2, respAlt, eibfnAlt];
}

export function toArray<T>(input: T | [T]): [T] {
export function toArray<T>(input: T | T[]): T[] {
return Array.isArray(input) ? input : [input];
}
14 changes: 8 additions & 6 deletions packages/vsce/src/utils/profileManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,14 @@ export class ProfileManagement {
if (isPlex) {
try {
const { response } = await getCache(session, { cacheToken: isPlex, nodiscard: false });
for (const plex of response.records.cicscicsplex || []) {
infoLoaded.push({
plexname: plex.plexname,
regions: [],
group: false,
});
if (response.records.cicscicsplex) {
for (const plex of toArray(response.records.cicscicsplex)) {
infoLoaded.push({
plexname: plex.plexname,
regions: [],
group: false,
});
}
}
} catch (error) {
window.showErrorMessage(
Expand Down
Loading