3087 GhidraProjectUtils: Don't get entry folder from path if entry is not CPE_SOURCE

This commit is contained in:
stephengeorgewest 2021-05-31 08:05:20 -06:00
parent 68a9c0a5a3
commit cc75f89272

View File

@ -388,9 +388,11 @@ public class GhidraProjectUtils {
// If the project is linked to an old Ghidra, keep the list of source folders that are
// linked to the Ghidra installation (after updating their paths to point to the new
// Ghidra installation).
IFolder entryFolder =
ResourcesPlugin.getWorkspace().getRoot().getFolder(entry.getPath());
if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE && entryFolder.isLinked() &&
IFolder entryFolder;
if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
entryFolder = ResourcesPlugin.getWorkspace().getRoot().getFolder(entry.getPath());
}
if (entryFolder != null && entryFolder.isLinked() &&
oldGhidraInstallPath != null &&
oldGhidraInstallPath.isPrefixOf(entryFolder.getLocation())) {
String origPath = entryFolder.getLocation().toString();