mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 07:05:24 +02:00
[328148] Dropping resource onto Eclipse IFile causes RSEG1003U unexpected exception
This commit is contained in:
parent
eb28270a16
commit
6625a40e96
1 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2002, 2008 IBM Corporation and others.
|
||||
* Copyright (c) 2002, 2010 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -26,6 +26,7 @@
|
|||
* David McKnight (IBM) - [196166] [usability][dnd] Changing the sort order of hosts in the SystemView should work by drag & drop
|
||||
* David McKnight (IBM) - [248922] [dnd] display error message when copy operation hits exception
|
||||
* Radoslav Gerganov (ProSyst) - [231428] [files] NPE on canceling copy operation from remote host
|
||||
* David McKnight (IBM) - [328148] Dropping resource onto Eclipse IFile causes RSEG1003U unexpected exception
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.ui.view;
|
||||
|
@ -34,6 +35,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||
import org.eclipse.core.resources.WorkspaceJob;
|
||||
|
@ -363,6 +365,10 @@ public class SystemDNDTransferRunnable extends WorkspaceJob
|
|||
IResource res = (IResource)tempFile;
|
||||
try
|
||||
{
|
||||
if (target instanceof IFile){
|
||||
// as per bug 328148, we should always use the parent of a file when it's a target
|
||||
target = ((IFile)target).getParent();
|
||||
}
|
||||
IPath destPath = target.getFullPath();
|
||||
destPath = destPath.append(res.getName());
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue