GP-1 Disable replace action for BadDataType

This commit is contained in:
ghidra1 2025-07-09 19:10:22 -04:00
parent f250cfeac4
commit 3f638e22b4

View file

@ -67,10 +67,18 @@ public class ReplaceDataTypeAction extends DockingAction {
return false;
}
if (!(node instanceof DataTypeNode)) {
if (!(node instanceof DataTypeNode dtNode)) {
return false;
}
return node.isModifiable();
if (!dtNode.isModifiable()) {
return false;
}
if (dtNode.getDataType() instanceof BadDataType) {
// Although BAD datatype should not appear in tree, if it does replace is
// not supported. Delete should be used instead.
return false;
}
return true;
}
private DataTypeTreeNode getSelectedDataTypeTreeNode(ActionContext context) {