Uncaught TypeError: Cannot read property 'notification' of null
bogomips opened this issue · comments
This occurs in a particular case:
- this.config.residents.length > 0
- anyoneHome == 0
- this.occupied === true
- the user does not set vacantCMD,
command = self.config.vacantCMD; //command
is null
---> https://github.com/ianperrin/MMM-NetworkScanner/blob/master/MMM-NetworkScanner.js#L152
---> https://github.com/ianperrin/MMM-NetworkScanner/blob/master/MMM-NetworkScanner.js#L153 <-- here the execption occurs
A possible trivial fix:
if (command) this.sendNotification(command.notification, command.payload);