handle NaN or undefined values in approveResources
Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
parent
70953f3194
commit
505ea28e8a
3
utils.js
3
utils.js
@ -21,6 +21,9 @@ export async function approveResources(req, username, request) {
|
|||||||
if (!(key in avail)) {
|
if (!(key in avail)) {
|
||||||
approved = false;
|
approved = false;
|
||||||
}
|
}
|
||||||
|
else if (isNaN(avail[key]) || isNaN(request[key])) {
|
||||||
|
approved = false;
|
||||||
|
}
|
||||||
else if (avail[key] - request[key] < 0) {
|
else if (avail[key] - request[key] < 0) {
|
||||||
approved = false;
|
approved = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user