Skip to content

Commit

Permalink
skip empty messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rusq committed Apr 10, 2024
1 parent ffd4532 commit e9727ce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/viewer/source/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/rusq/slack"
"github.com/rusq/slackdump/v3/export"
"github.com/rusq/slackdump/v3/internal/structures"
"github.com/rusq/slackdump/v3/logger"
)

// Export implements viewer.Sourcer for the zip file Slack export format.
Expand Down Expand Up @@ -116,7 +117,11 @@ func (e *Export) walkChannelMessages(channelID string, fn func(m *slack.Message)
if err != nil {
return err
}
for _, m := range em {
for i, m := range em {
if m.Msg == nil {
logger.Default.Debugf("skipping an empty message in %s at index %d", pth, i)
continue
}
if err := fn(&slack.Message{Msg: *m.Msg}); err != nil {
return err
}
Expand Down

0 comments on commit e9727ce

Please sign in to comment.