Fix nullpointer exception

Former-commit-id: d39a33b1685dcb24affa55bc22b030be94e2ca4d [formerly 6caa2ccad8b8e49b084e2c279be4d9160e9e3a2d]
Former-commit-id: cf2792124846ae1531b14c93061e80a7d97f0487
This commit is contained in:
Ghost_chu committed 2018-12-29 20:34:05 +08:00
1 parent 6ebf29e556
commit f16c4a4dc3
2 files changed
+14 -7

No files matched your search

@@ -145,13 +145,20 @@ public class Util {
List<RentRegion> regions = me.wiefferink.areashop.tools.Utils.getImportantRentRegions(b.getLocation());
boolean passTheRegionCheck = false;
for (RentRegion rentRegion : regions) {
Util.debugLog("Region: "+rentRegion.getName());
Util.debugLog("Owner: "+rentRegion.getOwner().toString());
Util.debugLog("Renter: "+rentRegion.getRenter().toString());
Util.debugLog("LandLore: "+rentRegion.getLandlord().toString());
if((rentRegion.getRenter()==player)||(rentRegion.getOwner()==player)||(rentRegion.getLandlord()==player)) {
if(rentRegion.getRenter()!=null&&rentRegion.getRenter()==player) {
passTheRegionCheck=true;
break; //If there passed, will continue to check BlockState
Util.debugLog("Passed check: Same renter.");
break;
}
if(rentRegion.getOwner()!=null&&rentRegion.getOwner()==player) {
passTheRegionCheck=true;
Util.debugLog("Passed check: Same owner.");
break;
}
if(rentRegion.getLandlord()!=null&&rentRegion.getLandlord()==player) {
passTheRegionCheck=true;
Util.debugLog("Passed check: Same landlord.");
break;
}
}
if(!passTheRegionCheck) {