mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 335180 - Remote debugging and virtual folders =>
java.lang.NullPointerException
This commit is contained in:
parent
8445aa5086
commit
33d6e7c0db
1 changed files with 16 additions and 5 deletions
|
@ -1883,16 +1883,27 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
|
|||
|
||||
if (container instanceof CProjectSourceContainer) {
|
||||
IProject project = ((CProjectSourceContainer) container).getProject();
|
||||
if (project != null && project.exists())
|
||||
pathToAdd = project.getLocation().toPortableString();
|
||||
if (project != null && project.exists()) {
|
||||
IPath location = project.getLocation();
|
||||
if (location != null) {
|
||||
pathToAdd = location.toPortableString();
|
||||
}
|
||||
}
|
||||
} else if (container instanceof ProjectSourceContainer) { // For backward compatibility
|
||||
IProject project = ((ProjectSourceContainer) container).getProject();
|
||||
if (project != null && project.exists())
|
||||
pathToAdd = project.getLocation().toPortableString();
|
||||
if (project != null && project.exists()) {
|
||||
IPath location = project.getLocation();
|
||||
if (location != null) {
|
||||
pathToAdd = location.toPortableString();
|
||||
}
|
||||
}
|
||||
} else if (container instanceof FolderSourceContainer) {
|
||||
IContainer folderContainer = ((FolderSourceContainer) container).getContainer();
|
||||
if (folderContainer != null && folderContainer.exists()) {
|
||||
pathToAdd = folderContainer.getLocation().toPortableString();
|
||||
IPath location = folderContainer.getLocation();
|
||||
if (location != null) {
|
||||
pathToAdd = location.toPortableString();
|
||||
}
|
||||
}
|
||||
} if (container instanceof DirectorySourceContainer) {
|
||||
File dir = ((DirectorySourceContainer) container).getDirectory();
|
||||
|
|
Loading…
Add table
Reference in a new issue