Ghidra is a software reverse engineering (SRE) framework
GT-3116 - Fixed exception on FillOutStructureCmd due to recent changes
dragonmacherdf971ee613d8
diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerActionContext.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerActionContext.javaindex 4ffcc89045..9d396523ca 100644--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerActionContext.java+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerActionContext.java@@ -17,11 +17,8 @@ package ghidra.app.plugin.core.decompile;import ghidra.app.context.NavigatableActionContext;import ghidra.app.context.RestrictedAddressSetContext;-import ghidra.app.decompiler.ClangToken;import ghidra.app.decompiler.component.DecompilerPanel;-import ghidra.app.decompiler.component.DecompilerUtils;import ghidra.program.model.address.Address;-import ghidra.program.util.ProgramLocation;public class DecompilerActionContext extends NavigatableActionContextimplements RestrictedAddressSetContext {@@ -51,26 +48,4 @@ public class DecompilerActionContext extends NavigatableActionContextpublic DecompilerPanel getDecompilerPanel() {return getComponentProvider().getDecompilerPanel();}-- @Override- public ProgramLocation getLocation() {-- // prefer the selection over the current location- DecompilerPanel decompilerPanel = getDecompilerPanel();- ClangToken token = decompilerPanel.getSelectedToken();- if (token == null) {- token = decompilerPanel.getTokenAtCursor();- }-- if (token == null) {- return null;- }-- Address address = DecompilerUtils.getClosestAddress(program, token);- if (address == null) {- return null;- }-- return new ProgramLocation(program, address);- }}diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/FillOutStructureCmd.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/FillOutStructureCmd.javaindex e82ddf5225..b4c19049cb 100644--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/FillOutStructureCmd.java+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/FillOutStructureCmd.java@@ -85,7 +85,7 @@ public class FillOutStructureCmd extends BackgroundCommand {super("Fill Out Structure", true, false, true);this.tool = tool;this.currentProgram = program;- this.currentLocation = location;+ this.currentLocation = Objects.requireNonNull(location);}@Override