Check base to prevent NaN values

This commit is contained in:
yuanchuan 2023-01-08 08:44:47 +08:00
parent 6c783dff4b
commit dfc6fdd932
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ function map2d(value, min, max, amp = 1) {
function calc_with(base) {
return v => {
if (is_empty(v)) {
if (is_empty(v) || is_empty(base)) {
return base;
}
if (/^[+*-\/%][.\d\s]/.test(v)) {