directmedia: fix panic if url preview has no photo
This commit is contained in:
@@ -175,7 +175,7 @@ func (tc *TelegramConnector) Download(ctx context.Context, mediaID networkid.Med
|
|||||||
Msg("downloading webpage photo")
|
Msg("downloading webpage photo")
|
||||||
readyTransferer = transferer.WithPhoto(pc)
|
readyTransferer = transferer.WithPhoto(pc)
|
||||||
} else {
|
} else {
|
||||||
return nil, fmt.Errorf("not a photo: %T", pc.TypeName())
|
return nil, fmt.Errorf("no photo found in webpage item")
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("unhandled media type %T", msgMedia)
|
return nil, fmt.Errorf("unhandled media type %T", msgMedia)
|
||||||
|
|||||||
Reference in New Issue
Block a user