Apply strictNullChecks to src/utils/pillify.tsx (#10456)

* apply strictNullChecks to src/utils/pillify.tsx

* include change to utility

* apply strictNullChecks to src/utils/permalinks
This commit is contained in:
Kerry 2023-03-28 10:07:49 +13:00 committed by GitHub
parent cd700e20fc
commit ae50eee135
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View file

@ -37,8 +37,8 @@ export enum PillType {
EventInOtherRoom = "TYPE_EVENT_IN_OTHER_ROOM",
}
export const pillRoomNotifPos = (text: string): number => {
return text.indexOf("@room");
export const pillRoomNotifPos = (text: string | null): number => {
return text?.indexOf("@room") ?? -1;
};
export const pillRoomNotifLen = (): number => {