mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
Memory Map: ensure columns exist on initialization
The Memory Map plugin configures the maximum and minimum size of some of
the columns.
This initialization does not take into account that a user is able to
hide columns, which results in a null pointer exception.
This commit checks that these objects are not null before configuring
them.
Fixes: f4b89fd26c
("GP-4984 - Fixed row selection while using the filter; updated columns to be resizable")
This commit is contained in:
parent
f1dcb64e22
commit
c7336e8d19
1 changed files with 33 additions and 19 deletions
|
@ -473,41 +473,55 @@ class MemoryMapProvider extends ComponentProviderAdapter {
|
|||
TableColumn column = table.getColumn(MemoryMapModel.READ_COL);
|
||||
int width = 25;
|
||||
int maxWidth = resizable ? Integer.MAX_VALUE : width;
|
||||
column.setMaxWidth(maxWidth);
|
||||
column.setMinWidth(width);
|
||||
column.setResizable(resizable);
|
||||
if (column != null) {
|
||||
column.setMaxWidth(maxWidth);
|
||||
column.setMinWidth(width);
|
||||
column.setResizable(resizable);
|
||||
}
|
||||
|
||||
column = table.getColumn(MemoryMapModel.WRITE_COL);
|
||||
column.setMaxWidth(maxWidth);
|
||||
column.setMinWidth(width);
|
||||
column.setResizable(resizable);
|
||||
if (column != null) {
|
||||
column.setMaxWidth(maxWidth);
|
||||
column.setMinWidth(width);
|
||||
column.setResizable(resizable);
|
||||
}
|
||||
|
||||
column = table.getColumn(MemoryMapModel.EXECUTE_COL);
|
||||
column.setMaxWidth(maxWidth);
|
||||
column.setMinWidth(width);
|
||||
column.setResizable(resizable);
|
||||
if (column != null) {
|
||||
column.setMaxWidth(maxWidth);
|
||||
column.setMinWidth(width);
|
||||
column.setResizable(resizable);
|
||||
}
|
||||
|
||||
column = table.getColumn(MemoryMapModel.VOLATILE_COL);
|
||||
width = 65;
|
||||
maxWidth = resizable ? Integer.MAX_VALUE : width;
|
||||
column.setMaxWidth(maxWidth);
|
||||
column.setMinWidth(width);
|
||||
column.setResizable(resizable);
|
||||
if (column != null) {
|
||||
column.setMaxWidth(maxWidth);
|
||||
column.setMinWidth(width);
|
||||
column.setResizable(resizable);
|
||||
}
|
||||
|
||||
column = table.getColumn(MemoryMapModel.ARTIFICIAL_COL);
|
||||
column.setMaxWidth(maxWidth);
|
||||
column.setMinWidth(width);
|
||||
column.setResizable(resizable);
|
||||
if (column != null) {
|
||||
column.setMaxWidth(maxWidth);
|
||||
column.setMinWidth(width);
|
||||
column.setResizable(resizable);
|
||||
}
|
||||
|
||||
column = table.getColumn(MemoryMapModel.BLOCK_TYPE_COL);
|
||||
width = 25;
|
||||
maxWidth = resizable ? Integer.MAX_VALUE : width;
|
||||
column.setMinWidth(width);
|
||||
if (column != null) {
|
||||
column.setMinWidth(width);
|
||||
}
|
||||
|
||||
column = table.getColumn(MemoryMapModel.INIT_COL);
|
||||
column.setMaxWidth(maxWidth);
|
||||
column.setMinWidth(width);
|
||||
column.setResizable(resizable);
|
||||
if (column != null) {
|
||||
column.setMaxWidth(maxWidth);
|
||||
column.setMinWidth(width);
|
||||
column.setResizable(resizable);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue