diff options
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java index 0055b27808..6f00daf02e 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java @@ -376,9 +376,11 @@ public class StagingView extends ViewPart { new Transfer[] { LocalSelectionTransfer.getTransfer() }, new DropTargetAdapter() { public void drop(DropTargetEvent event) { - final IStructuredSelection selection = (IStructuredSelection) stagedTableViewer - .getSelection(); - unstage(selection); + if (event.data instanceof IStructuredSelection) { + final IStructuredSelection selection = (IStructuredSelection) event.data; + if (selection.getFirstElement() instanceof StagingEntry) + unstage(selection); + } } public void dragOver(DropTargetEvent event) { @@ -459,9 +461,11 @@ public class StagingView extends ViewPart { new Transfer[] { LocalSelectionTransfer.getTransfer() }, new DropTargetAdapter() { public void drop(DropTargetEvent event) { - final IStructuredSelection selection = (IStructuredSelection) unstagedTableViewer - .getSelection(); - stage(selection); + if (event.data instanceof IStructuredSelection) { + final IStructuredSelection selection = (IStructuredSelection) event.data; + if (selection.getFirstElement() instanceof StagingEntry) + stage(selection); + } } public void dragOver(DropTargetEvent event) { |