Check for error before printing message

This commit is contained in:
Peter Stuifzand 2018-07-07 20:27:00 +02:00
parent 97a98bbfed
commit 55b279f363

View File

@ -353,11 +353,15 @@ func (b *memoryBackend) ProcessContent(channel, fetchURL, contentType string, bo
for _, item := range items { for _, item := range items {
item.Read = false item.Read = false
err = b.channelAddItem(conn, channel, item) err = b.channelAddItem(conn, channel, item)
log.Printf("ERROR: %s\n", err) if err != nil {
log.Printf("ERROR: %s\n", err)
}
} }
err = b.updateChannelUnreadCount(conn, channel) err = b.updateChannelUnreadCount(conn, channel)
log.Printf("error: while updating channel unread count for %s: %s\n", channel, err) if err != nil {
log.Printf("error: while updating channel unread count for %s: %s\n", channel, err)
}
return nil return nil
} }