Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Don't break up as URL for autocomplete if location bar text isn't a URL
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Apr 4, 2018
1 parent 4563685 commit d308fd5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/common/lib/siteSuggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ const tokenizeInput = (data) => {
}
}

if (url && isUrl(url)) {
const parsedUrl = urlParse(url.toLowerCase())
const parsedUrl = typeof url === 'string' && isUrl(url) && urlParse(url.toLowerCase())

if (parsedUrl && (parsedUrl.hash || parsedUrl.host || parsedUrl.pathname || parsedUrl.query || parsedUrl.protocol)) {
if (parsedUrl.hash) {
parts.push(parsedUrl.hash.slice(1))
}
Expand Down

0 comments on commit d308fd5

Please sign in to comment.