Skip to content

Commit 8386006

Browse files
committed
guard metadata spread against undefined.
1 parent 8b88881 commit 8386006

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/notebooks/deepnote/deepnoteDataConverter.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ export class DeepnoteDataConverter {
235235

236236
const metadata: Record<string, unknown> = {
237237
cellId,
238-
...blockMetadata,
238+
...(blockMetadata ?? {}),
239239
cellIndex
240240
};
241241

@@ -303,7 +303,7 @@ export class DeepnoteDataConverter {
303303
// Merge in order: cellId, blockMetadata, cellIndex, executionCount, then output.metadata (wins conflicts)
304304
const metadata: Record<string, unknown> = {
305305
cellId,
306-
...blockMetadata,
306+
...(blockMetadata ?? {}),
307307
cellIndex
308308
};
309309

@@ -330,7 +330,7 @@ export class DeepnoteDataConverter {
330330

331331
const metadata: Record<string, unknown> = {
332332
cellId,
333-
...blockMetadata,
333+
...(blockMetadata ?? {}),
334334
cellIndex
335335
};
336336

@@ -344,7 +344,7 @@ export class DeepnoteDataConverter {
344344
if ('text' in output && output.text) {
345345
const metadata: Record<string, unknown> = {
346346
cellId,
347-
...blockMetadata,
347+
...(blockMetadata ?? {}),
348348
cellIndex
349349
};
350350

@@ -362,7 +362,7 @@ export class DeepnoteDataConverter {
362362
if ('text' in output && output.text) {
363363
const metadata: Record<string, unknown> = {
364364
cellId,
365-
...blockMetadata,
365+
...(blockMetadata ?? {}),
366366
cellIndex
367367
};
368368

0 commit comments

Comments
 (0)