mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-09-20 12:58:33 +02:00
Fixed divide-by-zero bug
This commit is contained in:
parent
63da40689d
commit
4e2c21b1ba
@ -270,7 +270,11 @@ function evalBinary(exp, workerScript){
|
|||||||
resolve(expLeft*expRight);
|
resolve(expLeft*expRight);
|
||||||
break;
|
break;
|
||||||
case "/":
|
case "/":
|
||||||
|
if (expRight === 0) {
|
||||||
|
reject(makeRuntimeRejectMsg(workerScript, "ERROR: Divide by zero"));
|
||||||
|
} else {
|
||||||
resolve(expLeft/expRight);
|
resolve(expLeft/expRight);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "%":
|
case "%":
|
||||||
resolve(expLeft%expRight);
|
resolve(expLeft%expRight);
|
||||||
|
Loading…
Reference in New Issue
Block a user