repositories
/
e-mobility-charging-stations-simulator.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
56f9459
)
fix: fix worker set elementsPerWorker sanity check
author
Jérôme Benoit
<jerome.benoit@sap.com>
Tue, 19 Mar 2024 17:58:30 +0000
(18:58 +0100)
committer
Jérôme Benoit
<jerome.benoit@sap.com>
Tue, 19 Mar 2024 17:58:30 +0000
(18:58 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/worker/WorkerSet.ts
patch
|
blob
|
blame
|
history
diff --git
a/src/worker/WorkerSet.ts
b/src/worker/WorkerSet.ts
index d0f80b6ed59a54342430991ff4d318d86e0a5402..10606d2e498639bb6d0097f2d6c3740465746113 100644
(file)
--- a/
src/worker/WorkerSet.ts
+++ b/
src/worker/WorkerSet.ts
@@
-36,7
+36,10
@@
export class WorkerSet extends WorkerAbstract<WorkerData> {
if (!Number.isSafeInteger(this.workerOptions.elementsPerWorker)) {
throw new TypeError('Elements per worker must be an integer')
}
- if (this.workerOptions.elementsPerWorker <= 0) {
+ if (
+ typeof this.workerOptions.elementsPerWorker === 'number' &&
+ this.workerOptions.elementsPerWorker <= 0
+ ) {
throw new RangeError('Elements per worker must be greater than zero')
}
this.workerSet = new Set<WorkerSetElement>()