A malformed file image URL breaks transcript rendering

This commit is contained in:
Ian Gulliver
2026-10-16 14:31:25 -07:00
parent 9f9556b1e4
commit ca24f2cabb
4 changed files with 12 additions and 5 deletions
+5 -1
View File
@@ -351,7 +351,11 @@ function worktreeImageURL(path: string, taskId: string | undefined): string | nu
}
let file = path;
if (/^file:\/\//i.test(file)) {
file = decodeURI(file.slice("file://".length));
try {
file = decodeURI(file.slice("file://".length));
} catch {
return null;
}
} else if (/^[a-z][a-z0-9+.-]*:/i.test(file)) {
return null;
}