Skip to content

Commit

Permalink
Handle empty paste array (#202038)
Browse files Browse the repository at this point in the history
  • Loading branch information
lramos15 committed Jan 8, 2024
1 parent fbb656b commit e1f8ddd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/files/browser/fileActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ export const pasteFileHandler = async (accessor: ServicesAccessor, fileList?: Fi

const toPaste = await getFilesToPaste(fileList, clipboardService);

if (confirmPasteNative) {
if (confirmPasteNative && toPaste?.length >= 1) {
const message = toPaste.length > 1 ?
nls.localize('confirmMultiPasteNative', "Are you sure you want to paste the following {0} items?", toPaste.length) :
nls.localize('confirmPasteNative', "Are you sure you want to paste '{0}'?", basename(toPaste[0].fsPath));
Expand Down

0 comments on commit e1f8ddd

Please sign in to comment.