MM-12109 Fix handling of return value of getRedirectLocation (#2102)
This commit is contained in:
parent
3005a39f07
commit
675c440cd7
1 changed files with 7 additions and 1 deletions
|
|
@ -102,7 +102,13 @@ export default class PostBodyAdditionalContent extends PureComponent {
|
|||
imageUrl = `https://i.ytimg.com/vi/${videoId}/hqdefault.jpg`;
|
||||
ImageCacheManager.cache(null, `https://i.ytimg.com/vi/${videoId}/default.jpg`, () => true);
|
||||
} else {
|
||||
const shortenedLink = await this.props.actions.getRedirectLocation(link);
|
||||
const {data} = await this.props.actions.getRedirectLocation(link);
|
||||
|
||||
let shortenedLink;
|
||||
if (data && data.location) {
|
||||
shortenedLink = data.location;
|
||||
}
|
||||
|
||||
if (shortenedLink) {
|
||||
if (isImageLink(shortenedLink)) {
|
||||
imageUrl = shortenedLink;
|
||||
|
|
|
|||
Loading…
Reference in a new issue