Ghidra is a software reverse engineering (SRE) framework
GP-2387: Fix NPE when trying to sync while closing Debugger
Dan2640a07838e9
diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerStaticSyncTrait.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerStaticSyncTrait.javaindex 4d0579c54b..d16079efd7 100644--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerStaticSyncTrait.java+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerStaticSyncTrait.java@@ -196,7 +196,7 @@ public class DebuggerStaticSyncTrait {}protected void doSyncCursorIntoStatic(ProgramLocation location) {- if (location == null) {+ if (location == null || mappingService == null) {return;}ProgramLocation staticLoc = mappingService.getStaticLocationFromDynamic(location);@@ -208,7 +208,7 @@ public class DebuggerStaticSyncTrait {protected void doSyncCursorFromStatic() {TraceProgramView view = current.getView(); // NB. Used for snap (don't want emuSnap)- if (view == null || currentStaticLocation == null) {+ if (view == null || currentStaticLocation == null || mappingService == null) {return;}ProgramLocation dynamicLoc =@@ -246,7 +246,8 @@ public class DebuggerStaticSyncTrait {}protected ProgramSelection doSyncSelectionIntoStatic(Program program, ProgramSelection sel) {- if (program == null || sel == null || currentStaticProgram == null) {+ if (program == null || sel == null || currentStaticProgram == null ||+ mappingService == null) {return null;}TraceProgramView view = (TraceProgramView) program;@@ -269,7 +270,8 @@ public class DebuggerStaticSyncTrait {protected ProgramSelection doSyncSelectionFromStatic() {TraceProgramView view = current.getView();- if (view == null || currentStaticProgram == null || currentStaticSelection == null) {+ if (view == null || currentStaticProgram == null || currentStaticSelection == null ||+ mappingService == null) {return null;}AddressSet mapped =