Skip to content

Commit e84eff3

Browse files
fix(trash): accessing from undefined on permanent deleting (codesandbox#3523)
* fix(trash): accessing from undefined after delete * Use Optional Chaining Co-Authored-By: Michaël De Boey <[email protected]> * Remove unused get Co-Authored-By: Michaël De Boey <[email protected]> Co-authored-by: Michaël De Boey <[email protected]>
1 parent e8965fe commit e84eff3

File tree

1 file changed

+3
-2
lines changed
  • packages/app/src/app/pages/Dashboard/Content/Sandboxes

1 file changed

+3
-2
lines changed

packages/app/src/app/pages/Dashboard/Content/Sandboxes/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import getDefinition from '@codesandbox/common/lib/templates';
44
export function getPossibleTemplates(sandboxes: any[]) {
55
return uniqBy(
66
sandboxes.map(x => {
7-
const template = getDefinition(x.source.template);
7+
const templateId = x.source?.template;
8+
const template = getDefinition(templateId);
89

910
return {
10-
id: x.source.template,
11+
id: templateId,
1112
color: template.color,
1213
name: template.name,
1314
niceName: template.niceName,

0 commit comments

Comments
 (0)