Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,11 @@ function GlobalSearch() {

const handleItemLinkClick = (itemArg?: SearchItem, source?: string) => {
const item = itemArg || activeItem;
const type = getItemType(item) as SEARCH_ITEM_TYPES;
const type = getItemType(item);

// When there is no active item(or no search results) do nothing
// on pressing enter
if (!searchResults.length) return;

AnalyticsUtil.logEvent("NAVIGATE_TO_ENTITY_FROM_OMNIBAR", {
type,
Expand Down