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