Update packages/node_modules/@node-red/nodes/core/network/10-mqtt.js

Co-authored-by: Stephen McLaughlin <44235289+Steve-Mcl@users.noreply.github.com>
This commit is contained in:
Nick O'Leary 2024-09-11 15:23:03 +01:00 committed by GitHub
parent 7f77a414ec
commit de0546b251
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -696,7 +696,7 @@ module.exports = function(RED) {
// Ensure will payload, if set, is a string // Ensure will payload, if set, is a string
if (node.options.will && Object.hasOwn(node.options.will, 'payload')) { if (node.options.will && Object.hasOwn(node.options.will, 'payload')) {
let payload = node.options.will.payload let payload = node.options.will.payload
if (payload === null || payload === undefined) { if (payload === null || typeof payload === 'undefined') {
payload = ""; payload = "";
} else if (!Buffer.isBuffer(payload)) { } else if (!Buffer.isBuffer(payload)) {
if (typeof payload === "object") { if (typeof payload === "object") {