mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-22 21:09:51 +00:00
Fix #518 Trade station crashes when new station is named after a restart
This commit is contained in:
1 parent
9536bf1b78
commit
b9b71cf015
2 files changed
+11
-5
No files matched your search
@@ -25,6 +25,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.core.IErrorState;
|
||||
import forestry.api.mail.IMailAddress;
|
||||
import forestry.api.mail.IStamps;
|
||||
import forestry.api.mail.PostManager;
|
||||
@@ -173,7 +174,12 @@ public class MachineTrader extends TileBase {
|
||||
|
||||
/* STATE INFORMATION */
|
||||
public boolean isLinked() {
|
||||
return address.isValid() && getErrorState() != EnumErrorCode.NOTALPHANUMERIC && getErrorState() != EnumErrorCode.NOTUNIQUE;
|
||||
if (address == null || !address.isValid()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
IErrorState errorState = getErrorState();
|
||||
return errorState != EnumErrorCode.NOTALPHANUMERIC && errorState != EnumErrorCode.NOTUNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -274,7 +280,7 @@ public class MachineTrader extends TileBase {
|
||||
throw new NullPointerException("address must not be null");
|
||||
}
|
||||
|
||||
if (this.address.isValid() && this.address.equals(address)) {
|
||||
if (this.address != null && this.address.isValid() && this.address.equals(address)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user