This is an optional parameter and needs to be guarded, a simple
"truthy" check is enough, as eithers it's missing or a more complex
string (i.e., it cannot be '0' or the like)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
var properties = {};
if (values.log_ratelimit !== undefined) {
var properties = {};
if (values.log_ratelimit !== undefined) {
- properties = PVE.Parser.parsePropertyString(values.log_ratelimit);
- var matches = properties.rate.match(/^(\d+)\/(second|minute|hour|day)$/);
- if (matches) {
- properties.rate = matches[1];
- properties.unit = matches[2];
+ properties = PVE.Parser.parsePropertyString(values.log_ratelimit, 'enable');
+ if (properties.rate) {
+ var matches = properties.rate.match(/^(\d+)\/(second|minute|hour|day)$/);
+ if (matches) {
+ properties.rate = matches[1];
+ properties.unit = matches[2];
+ }
}
}
me.callParent([properties]);
}
}
me.callParent([properties]);