mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-23 13:16:48 +08:00
Fixed stack trace when cursor is not on a token
This commit is contained in:
+5
-1
@@ -82,8 +82,9 @@ public class ForceUnionAction extends AbstractDecompilerAction {
|
||||
if (dt instanceof TypeDef) {
|
||||
dt = ((TypeDef) dt).getBaseDataType();
|
||||
}
|
||||
if (dt instanceof Union)
|
||||
if (dt instanceof Union) {
|
||||
return (Union) dt;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -97,6 +98,9 @@ public class ForceUnionAction extends AbstractDecompilerAction {
|
||||
}
|
||||
|
||||
ClangToken tokenAtCursor = context.getTokenAtCursor();
|
||||
if (tokenAtCursor == null) {
|
||||
return false;
|
||||
}
|
||||
return findUnion(tokenAtCursor) != null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user