Skip to content

Commit 3b2e1cb

Browse files
authored
fix: topicAliasMaximum under must be under Connect properties (#1519)
1 parent 85c9341 commit 3b2e1cb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/client.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ function MqttClient (streamBuilder, options) {
270270
debug('MqttClient :: options.keepalive', options.keepalive)
271271
debug('MqttClient :: options.reconnectPeriod', options.reconnectPeriod)
272272
debug('MqttClient :: options.rejectUnauthorized', options.rejectUnauthorized)
273-
debug('MqttClient :: options.topicAliasMaximum', options.topicAliasMaximum)
273+
debug('MqttClient :: options.properties.topicAliasMaximum', options.properties.topicAliasMaximum)
274274

275275
this.options.clientId = (typeof options.clientId === 'string') ? options.clientId : defaultId()
276276

@@ -320,11 +320,11 @@ function MqttClient (streamBuilder, options) {
320320
// True if connection is first time.
321321
this._firstConnection = true
322322

323-
if (options.topicAliasMaximum > 0) {
324-
if (options.topicAliasMaximum > 0xffff) {
325-
debug('MqttClient :: options.topicAliasMaximum is out of range')
323+
if (options.properties && options.properties.topicAliasMaximum > 0) {
324+
if (options.properties.topicAliasMaximum > 0xffff) {
325+
debug('MqttClient :: options.properties.topicAliasMaximum is out of range')
326326
} else {
327-
this.topicAliasRecv = new TopicAliasRecv(options.topicAliasMaximum)
327+
this.topicAliasRecv = new TopicAliasRecv(options.properties.topicAliasMaximum)
328328
}
329329
}
330330

0 commit comments

Comments
 (0)