Skip to content

Commit 5a71285

Browse files
Merge pull request #6 from Tom-Hirschberger/development
Development
2 parents 48c2a16 + 1779cb0 commit 5a71285

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

node_helper.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ module.exports = NodeHelper.create({
5353
// });
5454

5555
child.on('close', function(code) {
56-
self.postProcessCommand(cmdIdx, curCmdConfig, curNotifications, scriptOutput.trim(), code)
56+
if (scriptOutput != null){
57+
scriptOutput = scriptOutput.trim()
58+
}
59+
self.postProcessCommand(cmdIdx, curCmdConfig, curNotifications, scriptOutput, code)
5760
});
5861
},
5962

@@ -152,7 +155,10 @@ module.exports = NodeHelper.create({
152155
console.log("Running "+ curCommand + " synchronous")
153156
let spawnOutput = spawnSync(curCommand, curArgs, options)
154157
returnCode = spawnOutput.status
155-
output = spawnOutput.stdout.trim()
158+
output = spawnOutput.stdout
159+
if (output != null){
160+
output = output.trim()
161+
}
156162
if(returnCode == null){
157163
returnCode = 1
158164
output += "Timeout"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "MMM-CommandToNotification",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "",
55
"main": "MMM-CommandToNotification",
66
"dependencies": {},

0 commit comments

Comments
 (0)