diff --git a/public/app/features/admin/Users/AnonUsersTable.tsx b/public/app/features/admin/Users/AnonUsersTable.tsx index ba467f8a79f7..4ac143119761 100644 --- a/public/app/features/admin/Users/AnonUsersTable.tsx +++ b/public/app/features/admin/Users/AnonUsersTable.tsx @@ -10,9 +10,18 @@ type Cell // A helper function to parse the user agent string and extract parts const parseUserAgent = (userAgent: string) => { + // If the user agent string doesn't contain a space, it's probably just the browser name + // or some other entity that are accessing grafana + if (!userAgent.includes(' ')) { + return { + browser: userAgent, + computer: '', + }; + } + const parts = userAgent.split(' '); return { - browser: userAgent.split(' ')[0], - computer: userAgent.split(' ')[1], + browser: parts[0], + computer: parts[1], }; };