Ghidra is a software reverse engineering (SRE) framework
GP-1490: Fixed URL issues in static mapper for programs in shared projects.
Dan88168f5ddb73
diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/utils/ProgramURLUtils.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/utils/ProgramURLUtils.javaindex 639117d7a5..ea5c0df68d 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/utils/ProgramURLUtils.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/utils/ProgramURLUtils.java@@ -23,6 +23,7 @@ import ghidra.framework.client.RepositoryAdapter;import ghidra.framework.model.*;import ghidra.framework.protocol.ghidra.GhidraURL;import ghidra.program.model.listing.Program;+import ghidra.util.Msg;public enum ProgramURLUtils {;@@ -33,7 +34,9 @@ public enum ProgramURLUtils {if (projectLocator == null) {return null;}- RepositoryAdapter repository = file.getParent().getProjectData().getRepository();+ DomainFolder parent = file.getParent();+ ProjectData projectData = parent == null ? null : parent.getProjectData();+ RepositoryAdapter repository = projectData == null ? null : projectData.getRepository();if (repository != null) { // There is an associated remote repoif (file.isVersioned()) { // The domain file exists thereServerInfo server = repository.getServerInfo();@@ -66,6 +69,11 @@ public enum ProgramURLUtils {}URL localProjURL = new URL(asString.substring(0, bangLoc));ProjectData projectData = project.getProjectData(localProjURL);+ if (projectData == null) {+ Msg.error(ProgramURLUtils.class, "The repository containing " + ghidraURL ++ " is not open in the Project manager.");+ return null;+ }return projectData.getFile(asString.substring(bangLoc + 1));}catch (MalformedURLException e) {