1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Check if name is undefined

Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
Hung-Han (Henry) Chen 2021-05-20 13:09:16 +03:00
parent b61ba7ef71
commit e97b30dae0
No known key found for this signature in database
GPG Key ID: 54B44603D251B788

View File

@ -67,7 +67,10 @@ function onMenuItemClick(menuItem: CatalogEntityContextMenu) {
} }
} }
function getNameParts(name: string): string[] { function getNameParts(name?: string) {
if (!name) {
return [];
}
const byWhitespace = name.split(/\s+/); const byWhitespace = name.split(/\s+/);
if (byWhitespace.length > 1) { if (byWhitespace.length > 1) {