connector/tomatrix: error early if client is nil
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
@@ -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()
|
log := zerolog.Ctx(ctx).With().Str("conversion_direction", "to_matrix").Logger()
|
||||||
ctx = log.WithContext(ctx)
|
ctx = log.WithContext(ctx)
|
||||||
|
|
||||||
|
if c.client == nil {
|
||||||
|
return nil, fmt.Errorf("telegram client is nil, we are likely logged out")
|
||||||
|
}
|
||||||
|
|
||||||
cm = &bridgev2.ConvertedMessage{}
|
cm = &bridgev2.ConvertedMessage{}
|
||||||
hasher := sha256.New()
|
hasher := sha256.New()
|
||||||
if len(msg.Message) > 0 {
|
if len(msg.Message) > 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user