Skip to content

Commit f3e8e32

Browse files
committed
GP-1411 corrected NPE
1 parent 7ccca37 commit f3e8e32

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/reloc/RelocationManager.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ private byte[] getOriginalBytes(Address addr, byte[] bytes) throws IOException {
9494
int byteCount = program.getDefaultPointerSize() > 4 ? 8 : 4;
9595
byte[] originalBytes = new byte[byteCount];
9696
AddressSourceInfo addressSourceInfo = program.getMemory().getAddressSourceInfo(addr);
97+
if (addressSourceInfo == null) {
98+
return null;
99+
}
97100
MemoryBlockSourceInfo memoryBlockSourceInfo = addressSourceInfo.getMemoryBlockSourceInfo();
98101
Optional<FileBytes> optional = memoryBlockSourceInfo.getFileBytes();
99102
if (!optional.isEmpty()) {

0 commit comments

Comments
 (0)