Fix #1325 Null Pointer Exception from broken mailbox

This commit is contained in:
mezz committed 2016-06-18 16:14:13 -07:00
1 parent c0a22f4a28
commit e9809238de
15 files changed
+51 -43

No files matched your search

@@ -23,6 +23,7 @@ import net.minecraft.world.WorldSavedData;
import com.mojang.authlib.GameProfile;
import forestry.api.mail.EnumAddressee;
import forestry.api.mail.EnumPostage;
import forestry.api.mail.EnumTradeStationState;
import forestry.api.mail.ILetter;
@@ -64,7 +65,7 @@ public class TradeStation extends WorldSavedData implements ITradeStation, IInve
public TradeStation(GameProfile owner, IMailAddress address) {
super(SAVE_NAME + address);
if (!address.isTrader()) {
if (address.getType() != EnumAddressee.TRADER) {
throw new IllegalArgumentException("TradeStation address must be a trader");
}
this.owner = owner;