Fixed stack trace when cursor is not on a token

This commit is contained in:
dragonmacher
2026-05-07 14:02:20 -04:00
parent 3d92a003fc
commit cd42c1199d
@@ -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;
}