diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TradeMenu.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TradeMenu.java index f69eeba..8daf89a 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TradeMenu.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TradeMenu.java @@ -88,8 +88,10 @@ public class TradeMenu extends Dialog { } private void setTrades() { - tradeHandler.setOfferedAmount(Integer.parseInt(leftCurrencyInput.getText())); - tradeHandler.setRequestedAmount(Integer.parseInt(rightCurrencyInput.getText())); + String leftCurreny = leftCurrencyInput.getText().equals("")? "0" : leftCurrencyInput.getText(); + String rightCurreny = rightCurrencyInput.getText().equals("")? "0" : rightCurrencyInput.getText(); + tradeHandler.setOfferedAmount(Integer.parseInt(leftCurreny)); + tradeHandler.setRequestedAmount(Integer.parseInt(rightCurreny)); tradeHandler.setOfferedJailCards(Integer.parseInt(leftSpecialCardSelector.getSelectedItem())); tradeHandler.setRequestedJailCards(Integer.parseInt(rightSpecialCardSelector.getSelectedItem()));