Without the check, deposit would trigger a division by zero. See this note:
Note that the security of the vault isn't compromised if we remove that check, but maxDeposit would be lying if it returned a non-zero value. Any non-zero value would cause deposit to revert. The EIP does not like reverts like that.