Better exception handling for getDomain
This commit is contained in:
parent
9efb046a06
commit
319890d138
5 changed files with 21 additions and 9 deletions
|
@ -43,7 +43,11 @@ import type {
|
|||
} from '../../components/conversation/GroupNotification';
|
||||
import type { PropsType as ProfileChangeNotificationPropsType } from '../../components/conversation/ProfileChangeNotification';
|
||||
|
||||
import { getDomain, isCallLink, isStickerPack } from '../../types/LinkPreview';
|
||||
import {
|
||||
getSafeDomain,
|
||||
isCallLink,
|
||||
isStickerPack,
|
||||
} from '../../types/LinkPreview';
|
||||
import type {
|
||||
AciString,
|
||||
PniString,
|
||||
|
@ -390,7 +394,7 @@ const getPreviewsForMessage = ({
|
|||
...preview,
|
||||
isStickerPack: isStickerPack(preview.url),
|
||||
isCallLink: isCallLink(preview.url),
|
||||
domain: getDomain(preview.url),
|
||||
domain: getSafeDomain(preview.url),
|
||||
image: preview.image ? getPropsForAttachment(preview.image) : undefined,
|
||||
}));
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue