Do not save SMTP for email netdata if username is not provided

This commit is contained in:
Kasra Bigdeli
2019-01-27 22:27:49 -08:00
parent 8457901d78
commit 551c2b5f07
+4 -1
View File
@@ -110,7 +110,10 @@ class DataStore {
const netDataInfo = self.data.get(NET_DATA_INFO) || {}
netDataInfo.isEnabled = netDataInfo.isEnabled || false
netDataInfo.data = netDataInfo.data || {}
netDataInfo.data.smtp = netDataInfo.data.smtp || {}
netDataInfo.data.smtp =
netDataInfo.data.smtp && netDataInfo.data.smtp.username
? netDataInfo.data.smtp
: {}
netDataInfo.data.slack = netDataInfo.data.slack || {}
netDataInfo.data.telegram = netDataInfo.data.telegram || {}
netDataInfo.data.pushBullet = netDataInfo.data.pushBullet || {}