mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
GP-3559 - Fixed NPE
This commit is contained in:
parent
9d7809902d
commit
a4992e431a
2 changed files with 31 additions and 24 deletions
|
@ -96,6 +96,9 @@ public class ByteViewerComponent extends FieldPanel implements FieldMouseListene
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getFieldDescription(FieldLocation fieldLoc, Field field) {
|
private String getFieldDescription(FieldLocation fieldLoc, Field field) {
|
||||||
|
if (field == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
ByteBlockInfo info = indexMap.getBlockInfo(fieldLoc.getIndex(), fieldLoc.getFieldNum());
|
ByteBlockInfo info = indexMap.getBlockInfo(fieldLoc.getIndex(), fieldLoc.getFieldNum());
|
||||||
if (info != null) {
|
if (info != null) {
|
||||||
String modelName = model.getName();
|
String modelName = model.getName();
|
||||||
|
|
|
@ -1300,8 +1300,12 @@ public class DecompilerPanel extends JPanel implements FieldMouseListener, Field
|
||||||
super(model, "Decompiler");
|
super(model, "Decompiler");
|
||||||
// In the decompiler each field represents a line, so make the field description
|
// In the decompiler each field represents a line, so make the field description
|
||||||
// simply be the line number
|
// simply be the line number
|
||||||
setFieldDescriptionProvider(
|
setFieldDescriptionProvider((l, f) -> {
|
||||||
(l, f) -> "line " + (l.getIndex().intValue() + 1) + ", " + f.getText());
|
if (f == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return "line " + (l.getIndex().intValue() + 1) + ", " + f.getText();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue