Check if content != nil before matching content

This commit is contained in:
Peter Stuifzand 2018-04-25 21:59:41 +02:00
parent 3590bbdb65
commit 58d0179a35

View File

@ -338,7 +338,7 @@ func (b *memoryBackend) ProcessContent(channel, fetchURL, contentType string, bo
b.channelAddItem(channel, item) b.channelAddItem(channel, item)
// Add items to notifications that match my name and websites // Add items to notifications that match my name and websites
if len(item.Content.Text) > 0 && nameRegex.MatchString(item.Content.Text) { if item.Content != nil && len(item.Content.Text) > 0 && nameRegex.MatchString(item.Content.Text) {
b.channelAddItem("notifications", item) b.channelAddItem("notifications", item)
} }
} }