File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ const connect = options => new Promise((resolve, reject) => {
134134 const valueKey = p . v !== undefined ? 'v' : '2' ;
135135 const valueStringKey = p . vs !== undefined ? 'vs' : '3' ;
136136 const valueBooleanKey = p . vb !== undefined ? 'vb' : '4' ;
137- let value ;
137+ let value = null ;
138138 propertyNameKey = propertyNameKeySplit [ propertyNameId ] ;
139139 if ( propertyCallback [ msg . topic ] [ propertyNameKey ] ) {
140140 if ( ! ( p [ valueKey ] === undefined ) ) {
@@ -148,19 +148,19 @@ const connect = options => new Promise((resolve, reject) => {
148148 if ( propertyNameKeyPrevious === '' ) {
149149 propertyNameKeyPrevious = propertyNameKeySplit [ propertyNameId ] ;
150150 }
151- if ( propertyNameKeyPrevious !== propertyNameKey ) {
151+ if ( propertyNameKeyPrevious !== propertyNameKey && propertyCallback [ msg . topic ] [ propertyNameKeyPrevious ] ) {
152152 propertyCallback [ msg . topic ] [ propertyNameKeyPrevious ] ( valueToSend ) ;
153153 propertyNameKeyPrevious = propertyNameKey ;
154154 valueToSend = { } ;
155155 }
156- if ( propertyNameKeySplit . length === 1 ) {
156+ if ( propertyNameKeySplit . length === 1 && value != null ) {
157157 valueToSend = value ;
158158 } else {
159159 const attributeName = propertyNameKeySplit [ attributeNameId ] ;
160160 valueToSend [ attributeName ] = value ;
161161 }
162162 } ) ;
163- if ( valueToSend !== { } ) {
163+ if ( valueToSend !== { } && propertyCallback [ msg . topic ] [ propertyNameKeyPrevious ] ) {
164164 propertyCallback [ msg . topic ] [ propertyNameKeyPrevious ] ( valueToSend ) ;
165165 }
166166 }
You can’t perform that action at this time.
0 commit comments