mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-19 06:03:50 +01: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);
|
||||
break;
|
||||
case "/":
|
||||
resolve(expLeft/expRight);
|
||||
if (expRight === 0) {
|
||||
reject(makeRuntimeRejectMsg(workerScript, "ERROR: Divide by zero"));
|
||||
} else {
|
||||
resolve(expLeft/expRight);
|
||||
}
|
||||
break;
|
||||
case "%":
|
||||
resolve(expLeft%expRight);
|
||||
|
Loading…
Reference in New Issue
Block a user