Fix nil pointer local notifications

This commit is contained in:
Andrea Maria Piana 2020-11-17 14:29:34 +01:00
parent b2d8f7f416
commit 70414c90b9
2 changed files with 5 additions and 3 deletions

View File

@ -1 +1 @@
0.63.9
0.63.10

View File

@ -553,7 +553,8 @@ func (b *GethStatusBackend) startNode(config *params.NodeConfig) (err error) {
services = appendIf(config.PermissionsConfig.Enabled, services, b.permissionsService())
services = appendIf(config.MailserversConfig.Enabled, services, b.mailserversService())
services = appendIf(config.WalletConfig.Enabled, services, b.walletService(config.NetworkID, accountsFeed))
services = appendIf(config.LocalNotificationsConfig.Enabled, services, b.localNotificationsService(config.NetworkID))
// We ignore for now local notifications flag as users who are upgrading have no mean to enable it
services = append(services, b.localNotificationsService(config.NetworkID))
manager := b.accountManager.GetManager()
if manager == nil {
@ -912,7 +913,8 @@ func (b *GethStatusBackend) AppStateChange(state string) {
return
}
if !localNotifications.IsWatchingWallet() {
// If we have no local notifications, force wallet stop, otherwise check if it's watching the wallet
if localNotifications == nil || (localNotifications != nil && !localNotifications.IsWatchingWallet()) {
err = wallet.Stop()
if err != nil {