mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-19 11:49:14 +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
@@ -82,7 +82,7 @@ public class PostRegistry implements IPostRegistry {
|
||||
*/
|
||||
@Override
|
||||
public boolean isValidTradeAddress(World world, IMailAddress address) {
|
||||
return address.isTrader() && address.getName().matches("^[a-zA-Z0-9]+$");
|
||||
return address != null && address.isTrader() && address.getName().matches("^[a-zA-Z0-9]+$");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,12 +92,12 @@ public class PostRegistry implements IPostRegistry {
|
||||
*/
|
||||
@Override
|
||||
public boolean isAvailableTradeAddress(World world, IMailAddress address) {
|
||||
return getTradeStation(world, address) == null;
|
||||
return address != null && getTradeStation(world, address) == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TradeStation getTradeStation(World world, IMailAddress address) {
|
||||
if (address.getName() == null) {
|
||||
if (address == null || address.getName() == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user