From: Peter Amstutz Date: Tue, 4 Feb 2020 18:18:45 +0000 (-0500) Subject: Don't crash if name is null or undefined X-Git-Tag: 2.0.0~3 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/c7d5dec8425d970c41a81c6328b91665acec1ec0 Don't crash if name is null or undefined no issue # Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- diff --git a/src/components/warning/warning.tsx b/src/components/warning/warning.tsx index bd330361..95e495d7 100644 --- a/src/components/warning/warning.tsx +++ b/src/components/warning/warning.tsx @@ -16,11 +16,12 @@ interface WarningComponentProps { } export const WarningComponent = ({ text, rules, message }: WarningComponentProps) => - rules.find(aRule => text.match(aRule) !== null) - ? message - ? - : - : null; + !text ? + : (rules.find(aRule => text.match(aRule) !== null) + ? message + ? + : + : null); interface IllegalNamingWarningProps { name: string;