Skip to content

Commit bff2ccb

Browse files
authored
Merge pull request #2813 from opossum-tool/fix-make-config-optional
fix: config should be optional
2 parents 59fb9a2 + c6df16d commit bff2ccb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/ElectronBackend/input/importFromFile.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import fs from 'fs';
88
import { cloneDeep } from 'lodash';
99
import { v4 as uuid4 } from 'uuid';
1010

11+
import { EMPTY_PROJECT_CONFIG } from '../../Frontend/shared-constants';
1112
import { AllowedFrontendChannels } from '../../shared/ipc-channels';
1213
import {
1314
Attributions,
@@ -167,7 +168,7 @@ export async function loadInputAndOutputFromFilePath(
167168
mainWindow.webContents.send(AllowedFrontendChannels.FileLoaded, {
168169
metadata: parsedInputData.metadata,
169170
resources: parsedInputData.resources,
170-
config: parsedInputData.config,
171+
config: parsedInputData.config ?? EMPTY_PROJECT_CONFIG,
171172
manualAttributions: {
172173
attributions: manualAttributions,
173174
resourcesToAttributions: parsedOutputData.resourcesToAttributions,

src/ElectronBackend/types/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export interface RawFrequentLicense {
4646
export interface ParsedOpossumInputFile {
4747
metadata: ProjectMetadata;
4848
resources: Resources;
49-
config: ProjectConfig;
49+
config?: ProjectConfig;
5050
externalAttributions: RawAttributions;
5151
resourcesToAttributions: ResourcesToAttributions;
5252
frequentLicenses?: Array<RawFrequentLicense>;

0 commit comments

Comments
 (0)