Blank BigNumber dishes are now treat as NaN instead of erroring

This commit is contained in:
n1474335 2018-01-05 18:20:06 +00:00
parent 7992a540ae
commit 283d3e1e7b
2 changed files with 6 additions and 1 deletions

View File

@ -194,7 +194,11 @@ Dish.prototype.translate = function(toType) {
this.type = Dish.ARRAY_BUFFER;
break;
case Dish.BIG_NUMBER:
this.value = new BigNumber(Utils.byteArrayToUtf8(this.value));
try {
this.value = new BigNumber(Utils.byteArrayToUtf8(this.value));
} catch (err) {
this.value = new BigNumber(NaN);
}
this.type = Dish.BIG_NUMBER;
break;
default:

View File

@ -1,4 +1,5 @@
import BigNumber from "bignumber.js";
/**
* Numerical base operations.
*