Skip to content

Commit

Permalink
Check node.broker is a string before trying to use it
Browse files Browse the repository at this point in the history
Fixes #4380
  • Loading branch information
knolleary committed Nov 27, 2023
1 parent a555541 commit 9c71d52
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ module.exports = function(RED) {
node.brokerurl = node.url;
} else {
// if the broker is ws:// or wss:// or tcp://
if (node.broker.indexOf("://") > -1) {
if ((typeof node.broker === 'string') && node.broker.indexOf("://") > -1) {
node.brokerurl = node.broker;
// Only for ws or wss, check if proxy env var for additional configuration
if (node.brokerurl.indexOf("wss://") > -1 || node.brokerurl.indexOf("ws://") > -1) {
Expand Down

0 comments on commit 9c71d52

Please sign in to comment.