Skip to content
Open
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
4 changes: 2 additions & 2 deletions packages/core/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ export async function getResultsJson() {
export function readResultsFromFile(
resultJsonPath: string,
scan: string
): Promise<CxResult[]> {
): Promise<CxResult[] | undefined> {
return new Promise((resolve, reject) => {
if (!fs.existsSync(resultJsonPath) || !scan) {
resolve([]);
resolve(undefined);
return;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/views/resultsView/astResultsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { validateConfigurationAndLicense } from "../../utils/common/configValida

export class AstResultsProvider extends ResultsProvider {
public process;
public loadedResults: CxResult[];
public loadedResults: CxResult[] | undefined;
private scan: Item | undefined;
private riskManagementView: riskManagementView;

Expand Down Expand Up @@ -87,8 +87,8 @@ export class AstResultsProvider extends ResultsProvider {
this.loadedResults = undefined;
const scanIDItem = getFromState(this.context, constants.scanIdKey);
let scanId = undefined;
if (scanIDItem && scanIDItem.name) {
scanId = getFromState(this.context, constants.scanIdKey).name;
if (scanIDItem && scanIDItem.id) {
scanId = getFromState(this.context, constants.scanIdKey).id;
}
if (scanId) {
await getResultsWithProgress(this.logs, scanId);
Expand Down
Loading