[`ty`] Fix playground crashes when accessing vendored files with leading slashes (#20661)

This commit is contained in:
Dan Parizher 2025-10-04 07:40:37 -04:00 committed by GitHub
parent 2ce3aba458
commit 2d44ad2f8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -100,6 +100,10 @@ export default function Playground() {
setError("File names cannot start with '/'."); setError("File names cannot start with '/'.");
return; return;
} }
if (newName.startsWith("vendored:")) {
setError("File names cannot start with 'vendored:'.");
return;
}
const handle = files.handles[file]; const handle = files.handles[file];
let newHandle: FileHandle | null = null; let newHandle: FileHandle | null = null;