Commit 0fcb2be
Guard against empty files array in FileEditorCodeMirror (#8423)
Return null early when the files prop is empty or undefined, preventing
a TypeError when accessing files[0].filename. This can occur when
localStorage returns an empty array for saved files.
Closes #8419
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 2d1482b commit 0fcb2be
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
0 commit comments