Skip to content

Commit b0a8146

Browse files
authored
fix: when no history (#361)
Signed-off-by: Philippe Martin <phmartin@redhat.com>
1 parent 2c5509d commit b0a8146

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/explorer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class Explorer {
8282

8383
const configFile = manifest[0].Config;
8484
const config = JSON.parse(await readFile(path.join(tmpdir, configFile), 'utf-8'));
85-
const history: History[] = config.history;
85+
const history: History[] | undefined = config.history;
8686
const layersResult: extensionApi.ImageFilesystemLayer[] = [];
8787
for (const layer of layers) {
8888
const currentLayer: extensionApi.ImageFilesystemLayer = {
@@ -125,7 +125,7 @@ export class Explorer {
125125
}
126126

127127
let i = layersResult.length - 1;
128-
for (const histo of history.slice().reverse()) {
128+
for (const histo of history?.slice().reverse() ?? []) {
129129
if (histo.empty_layer) {
130130
continue;
131131
}

0 commit comments

Comments
 (0)