Browse Source

Fix NPE if oldService is nil

kegan/per-service-poll
Kegan Dougal 8 years ago
parent
commit
7518ed1995
  1. 2
      src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go

2
src/github.com/matrix-org/go-neb/services/rssbot/rssbot.go

@ -174,7 +174,7 @@ func (s *rssBotService) Register(oldService types.Service, client *matrix.Client
var numOldFeeds int
oldFeedService, ok := oldService.(*rssBotService)
if !ok {
log.WithField("service_id", oldService.ServiceID()).Error("Old service isn't a rssBotService")
log.WithField("service", oldService).Error("Old service isn't a rssBotService")
} else {
numOldFeeds = len(oldFeedService.Feeds)
}

Loading…
Cancel
Save