Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check if procesedMesassure is an array of object, not just an array #643

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Fix: bad mqtt measure is progressing as a multiple measure after be procesed as hex string (#642)
Fix: search device and group for a command using entity type when provided to proper match (iota-node-lib#1211)
Fix: replace git:// to https:// url for npm dependences
Upgrade NodeJS version from 12 to 14 in Dockerfile
Expand Down
3 changes: 2 additions & 1 deletion lib/commonBindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ function messageHandler(topic, message, protocol) {
for (let i = 0; i < parsedMessage.length; i++) {
commandHandler.updateCommand(apiKey, deviceId, device, parsedMessage[i]);
}
} else if (parsedMessage && typeof parsedMessage === 'object') {
} else if (parsedMessage && Array.isArray(parsedMessage) && parsedMessage.every((x) => typeof x === 'object')) {
// it must be an array of object
multipleMeasures(apiKey, deviceId, device, parsedMessage);
} else {
config.getLogger().error(
Expand Down