diff --git a/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java b/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java index 6f520341c..a57b26164 100644 --- a/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java +++ b/contracts/javascore/ics20/src/main/java/ibc/ics20/ICS20Transfer.java @@ -191,7 +191,10 @@ public void tokenFallback(Address from, BigInteger value, byte[] _data) { Context.require(amount.equals(value), TAG + " : Mismatched amount"); Context.require(sender.equals(from.toString()), TAG + " : Sender address mismatched"); - Context.require(tokenContracts.get(denomination) == Context.getCaller(), + + Address tokenAddress = tokenContracts.get(denomination); + + Context.require(tokenAddress!=null && tokenAddress.equals(Context.getCaller()), TAG + " : Sender Token Contract not registered"); sendFungibleToken(denomination, amount, sender, receiver, sourcePort, sourceChannel, height,