Fix infinite loop when using a zero amount in a multiplication.

This commit is contained in:
Stefan Thomas
2012-12-13 11:28:37 -08:00
parent 25abc284be
commit 269abd0131
2 changed files with 34 additions and 0 deletions

View File

@@ -827,6 +827,13 @@ Amount.prototype.multiply = function (v) {
result = new Amount();
result._value = this._value.multiply(v._value);
}
else if (this.is_zero()) {
result = this.clone();
}
else if (v.is_zero()) {
result = this.clone();
result._value = BigInteger.ZERO.clone();
}
else {
var v1 = this._value;