Skip to content

Commit

Permalink
chore: add some nil checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Mar 11, 2024
1 parent 2235f0e commit c160aa3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions telegram/updates/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ func (s *internalState) Push(ctx context.Context, u tg.UpdatesClass) error {
}

func (s *internalState) Run(ctx context.Context) error {
if s == nil {
return errors.New("invalid: nil internalState")
}
if s.log == nil {
return errors.New("invalid: nil logger")
}
s.log.Debug("Starting updates handler")
defer s.log.Debug("Updates handler stopped")
s.getDifferenceLogger(ctx)
Expand Down

0 comments on commit c160aa3

Please sign in to comment.