mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-02 14:11:02 +01:00
Blank BigNumber dishes are now treat as NaN instead of erroring
This commit is contained in:
parent
7992a540ae
commit
283d3e1e7b
@ -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:
|
||||
|
@ -1,4 +1,5 @@
|
||||
import BigNumber from "bignumber.js";
|
||||
|
||||
/**
|
||||
* Numerical base operations.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user