mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-22 04:05:39 +00:00
GP-4217: Map null to null, not NPE
This commit is contained in:
parent
2d9a1ac539
commit
eb16898b32
@ -310,6 +310,9 @@ public class DBTraceGuestPlatform extends DBAnnotatedObject
|
||||
|
||||
@Override
|
||||
public Address mapHostToGuest(Address hostAddress) {
|
||||
if (hostAddress == null) {
|
||||
return null;
|
||||
}
|
||||
try (LockHold hold = LockHold.lock(manager.lock.readLock())) {
|
||||
Entry<Address, DBTraceGuestPlatformMappedRange> floorEntry =
|
||||
rangesByHostAddress.floorEntry(hostAddress);
|
||||
@ -322,6 +325,9 @@ public class DBTraceGuestPlatform extends DBAnnotatedObject
|
||||
|
||||
@Override
|
||||
public AddressRange mapHostToGuest(AddressRange hostRange) {
|
||||
if (hostRange == null) {
|
||||
return null;
|
||||
}
|
||||
try (LockHold hold = LockHold.lock(manager.lock.readLock())) {
|
||||
Entry<Address, DBTraceGuestPlatformMappedRange> floorEntry =
|
||||
rangesByHostAddress.floorEntry(hostRange.getMinAddress());
|
||||
@ -350,6 +356,9 @@ public class DBTraceGuestPlatform extends DBAnnotatedObject
|
||||
|
||||
@Override
|
||||
public Address mapGuestToHost(Address guestAddress) {
|
||||
if (guestAddress == null) {
|
||||
return null;
|
||||
}
|
||||
try (LockHold hold = LockHold.lock(manager.lock.readLock())) {
|
||||
Entry<Address, DBTraceGuestPlatformMappedRange> floorEntry =
|
||||
rangesByGuestAddress.floorEntry(guestAddress);
|
||||
@ -362,6 +371,9 @@ public class DBTraceGuestPlatform extends DBAnnotatedObject
|
||||
|
||||
@Override
|
||||
public AddressRange mapGuestToHost(AddressRange guestRange) {
|
||||
if (guestRange == null) {
|
||||
return null;
|
||||
}
|
||||
try (LockHold hold = LockHold.lock(manager.lock.readLock())) {
|
||||
Entry<Address, DBTraceGuestPlatformMappedRange> floorEntry =
|
||||
rangesByGuestAddress.floorEntry(guestRange.getMinAddress());
|
||||
|
Loading…
Reference in New Issue
Block a user