mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-09-30 00:56:56 +13:00
Fix out of bounds exception when pasting an empty selection
This commit is contained in:
parent
2af3e33097
commit
6868f6567b
2 changed files with 9 additions and 0 deletions
|
@ -236,6 +236,11 @@ public final class OpenFileSystemModel {
|
|||
|
||||
public void dropFilesIntoAsync(
|
||||
FileSystem.FileEntry target, List<FileSystem.FileEntry> files, boolean explicitCopy) {
|
||||
// We don't have to do anything in this case
|
||||
if (files.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ThreadHelper.runFailableAsync(() -> {
|
||||
BusyProperty.execute(busy, () -> {
|
||||
if (fileSystem == null) {
|
||||
|
|
|
@ -26,6 +26,10 @@ public class PasteAction implements LeafAction {
|
|||
? entries.get(0).getRawFileEntry()
|
||||
: model.getCurrentDirectory();
|
||||
var files = clipboard.getEntries();
|
||||
if (files.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
model.dropFilesIntoAsync(target, files, true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue