editor drag and drop mitigation for resources without scheme (#124946)

This commit is contained in:
Benjamin Pasero 2021-06-08 15:45:35 +02:00
parent bae654ad1d
commit 88875325a7
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65

View file

@ -75,7 +75,11 @@ export function extractEditorsDropData(e: DragEvent, externalOnly?: boolean): Ar
const rawResourcesData = e.dataTransfer.getData(DataTransfers.RESOURCES);
if (rawResourcesData) {
const resourcesRaw: string[] = JSON.parse(rawResourcesData);
editors.push(...resourcesRaw.map(resourceRaw => ({ resource: URI.parse(resourceRaw) })));
for (const resourceRaw of resourcesRaw) {
if (resourceRaw.indexOf(':') > 0) { // mitigate https://github.com/microsoft/vscode/issues/124946
editors.push({ resource: URI.parse(resourceRaw) });
}
}
}
} catch (error) {
// Invalid transfer