Skip to content

Commit

Permalink
connector/tomatrix: error early if client is nil
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Dec 4, 2024
1 parent 6eec7de commit a07bde3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/connector/tomatrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ func (c *TelegramClient) convertToMatrix(ctx context.Context, portal *bridgev2.P
log := zerolog.Ctx(ctx).With().Str("conversion_direction", "to_matrix").Logger()
ctx = log.WithContext(ctx)

if c.client == nil {
return nil, fmt.Errorf("telegram client is nil, we are likely logged out")
}

cm = &bridgev2.ConvertedMessage{}
hasher := sha256.New()
if len(msg.Message) > 0 {
Expand Down

0 comments on commit a07bde3

Please sign in to comment.