diff --git a/frontend/src/components/Table/Formatter/DomainsFormatter.tsx b/frontend/src/components/Table/Formatter/DomainsFormatter.tsx
index 4cc50475..fc32968c 100644
--- a/frontend/src/components/Table/Formatter/DomainsFormatter.tsx
+++ b/frontend/src/components/Table/Formatter/DomainsFormatter.tsx
@@ -10,35 +10,42 @@ interface Props {
color?: string;
}
-const DomainLink = ({ domain, color }: { domain: string; color?: string }) => {
+const DomainLink = ({ domain, color }: { domain?: string; color?: string }) => {
// when domain contains a wildcard, make the link go nowhere.
- let onClick: ((e: React.MouseEvent) => void) | undefined;
- if (domain.includes("*")) {
- onClick = (e: React.MouseEvent) => e.preventDefault();
+ // Apparently the domain can be null or undefined sometimes.
+ // This try is just a safeguard to prevent the whole formatter from breaking.
+ if (!domain) return null;
+ try {
+ let onClick: ((e: React.MouseEvent) => void) | undefined;
+ if (domain.includes("*")) {
+ onClick = (e: React.MouseEvent) => e.preventDefault();
+ }
+ return (
+
+ {domain}
+
+ );
+ } catch {
+ return null;
}
- return (
-
- {domain}
-
- );
};
export function DomainsFormatter({ domains, createdOn, niceName, provider, color }: Props) {
const elms: ReactNode[] = [];
- if (domains.length === 0 && !niceName) {
+ if ((!domains || domains.length === 0) && !niceName) {
elms.push(
Unknown
,
);
}
- if (niceName && provider !== "letsencrypt") {
+ if (!domains || (niceName && provider !== "letsencrypt")) {
elms.push(
{niceName}
@@ -46,7 +53,9 @@ export function DomainsFormatter({ domains, createdOn, niceName, provider, color
);
}
- domains.map((domain: string) => elms.push());
+ if (domains) {
+ domains.map((domain: string) => elms.push());
+ }
return (