From 30cba577163e8033e5d0a710904d0b47085648a4 Mon Sep 17 00:00:00 2001 From: shocoman Date: Mon, 29 Aug 2022 13:22:42 +0700 Subject: [PATCH] fix incorrect positioning of function call graph --- .../src/main/java/functioncalls/plugin/FcgProvider.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Ghidra/Features/GraphFunctionCalls/src/main/java/functioncalls/plugin/FcgProvider.java b/Ghidra/Features/GraphFunctionCalls/src/main/java/functioncalls/plugin/FcgProvider.java index 13b23b6bcb..0b27f475d0 100644 --- a/Ghidra/Features/GraphFunctionCalls/src/main/java/functioncalls/plugin/FcgProvider.java +++ b/Ghidra/Features/GraphFunctionCalls/src/main/java/functioncalls/plugin/FcgProvider.java @@ -172,6 +172,13 @@ public class FcgProvider if (!graphData.hasResults()) { return; } + + // The graph component won't contain valid perspective information if it's not 'initialized' + // (i.e. rendered or displayed to the user). It may happen if the graph has been kept minimized + // in the separate tab. Related method: `GraphComponent::viewerInitialized` + if (view.getGraphComponent().isUninitialized()) { + return; + } GraphPerspectiveInfo info = view.generateGraphPerspective(); graphData.setGraphPerspective(info);