You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Conform more of the codebase to strictNullChecks
(#10738)
This commit is contained in:
committed by
GitHub
parent
5e8488c283
commit
52017f62e1
@@ -191,12 +191,12 @@ export const options: Opts = {
|
||||
return {};
|
||||
},
|
||||
|
||||
formatHref: function (href: string, type: Type | string): string | null {
|
||||
formatHref: function (href: string, type: Type | string): string {
|
||||
switch (type) {
|
||||
case Type.RoomAlias:
|
||||
case Type.UserId:
|
||||
default: {
|
||||
return tryTransformEntityToPermalink(href);
|
||||
return tryTransformEntityToPermalink(href) ?? "";
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -209,7 +209,7 @@ export const options: Opts = {
|
||||
|
||||
className: "linkified",
|
||||
|
||||
target: function (href: string, type: Type | string): string | null {
|
||||
target: function (href: string, type: Type | string): string {
|
||||
if (type === Type.URL) {
|
||||
try {
|
||||
const transformed = tryTransformPermalinkToLocalHref(href);
|
||||
@@ -217,7 +217,7 @@ export const options: Opts = {
|
||||
transformed !== href || // if it could be converted to handle locally for matrix symbols e.g. @user:server.tdl and matrix.to
|
||||
decodeURIComponent(href).match(ELEMENT_URL_PATTERN) // for https links to Element domains
|
||||
) {
|
||||
return null;
|
||||
return "";
|
||||
} else {
|
||||
return "_blank";
|
||||
}
|
||||
@@ -225,7 +225,7 @@ export const options: Opts = {
|
||||
// malformed URI
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return "";
|
||||
},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user