mirror of
https://github.com/gchq/CyberChef
synced 2025-12-11 22:03:22 +00:00
Blank BigNumber dishes are now treat as NaN instead of erroring
This commit is contained in:
@@ -194,7 +194,11 @@ Dish.prototype.translate = function(toType) {
|
|||||||
this.type = Dish.ARRAY_BUFFER;
|
this.type = Dish.ARRAY_BUFFER;
|
||||||
break;
|
break;
|
||||||
case Dish.BIG_NUMBER:
|
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;
|
this.type = Dish.BIG_NUMBER;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import BigNumber from "bignumber.js";
|
import BigNumber from "bignumber.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Numerical base operations.
|
* Numerical base operations.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user