Skip to content

Commit

Permalink
fix(serve): check message id again to ensure it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Sep 30, 2023
1 parent 647eb68 commit 703890e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/dl/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ func serve(ctx context.Context,
return errors.New("no messages")
}

if iter.Value().Msg.GetID() != message {
return fmt.Errorf("msg may be deleted, id: %d", message)
}

item, err = convItem(iter.Value())
if err != nil {
return errors.Wrap(err, "convItem")
Expand Down

0 comments on commit 703890e

Please sign in to comment.