X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/af2033d68980358c141ad61c9f82a450d30f4acb..d86374acae51a7706b55c1333491f297df173a0a:/src/components/warning/warning.tsx?ds=sidebyside

diff --git a/src/components/warning/warning.tsx b/src/components/warning/warning.tsx
index bd330361..d459a37d 100644
--- a/src/components/warning/warning.tsx
+++ b/src/components/warning/warning.tsx
@@ -2,12 +2,12 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from "react";
-import { ErrorIcon } from "~/components/icon/icon";
+import React from "react";
+import { ErrorIcon } from "components/icon/icon";
 import { Tooltip } from "@material-ui/core";
-import { disallowSlash } from "~/validators/valid-name";
+import { disallowSlash } from "validators/valid-name";
 import { connect } from "react-redux";
-import { RootState } from "~/store/store";
+import { RootState } from "store/store";
 
 interface WarningComponentProps {
     text: string;
@@ -16,11 +16,12 @@ interface WarningComponentProps {
 }
 
 export const WarningComponent = ({ text, rules, message }: WarningComponentProps) =>
-    rules.find(aRule => text.match(aRule) !== null)
-        ? message
-            ? <Tooltip title={message}><ErrorIcon /></Tooltip>
-            : <ErrorIcon />
-        : null;
+    !text ? <Tooltip title={"No name"}><ErrorIcon /></Tooltip>
+        : (rules.find(aRule => text.match(aRule) !== null)
+            ? message
+                ? <Tooltip title={message}><ErrorIcon /></Tooltip>
+                : <ErrorIcon />
+            : null);
 
 interface IllegalNamingWarningProps {
     name: string;
