Submitted by cmichel
The TokenHandler.transfer should handle the if (token.tokenType == TokenType.Ether) case first, as if the token type is Ether but netTransferExternal <= 0 it treats the token as an ERC20 token and tries to call ERC20 functions on it.
Luckily, trying to call ERC20 functions on the invalid token address will revert which is the desired behavior.
We still recommend reordering the branches and adding a netTransferExternal <= 0 check. The code becomes cleaner and its more obvious that the transaction will fail.
jeffywu (Notional) confirmed
