Fix: Warnings with no ttl

Check if ttl exists before sanitizing
This commit is contained in:
wooferguy 2023-07-11 22:08:54 +12:00
parent da6bd8b621
commit 3f23212514

View File

@ -63,9 +63,11 @@ module.exports = function(RED) {
expire = 10800;
node.warn("Expire time too high, using maximum setting of 10800s (3 hours) retry duration");
}
if (!Number.isInteger(ttl) || ttl<=0) {
ttl = null;
node.warn("No valid number for TTL found, not set");
if (ttl !== null) {
if(!Number.isInteger(ttl) || ttl <= 0) {
ttl = null;
node.warn("No valid number for TTL found, not set");
}
}
if (typeof msg.payload === 'undefined') { msg.payload = "(undefined msg.payload)"; }
if (typeof(msg.payload) === 'object') {