diff --git a/js/twister_following.js b/js/twister_following.js index 4fc54c2..5dc8d6a 100644 --- a/js/twister_following.js +++ b/js/twister_following.js @@ -367,12 +367,18 @@ function userSearchKeypress(item) { // Enter pressed var dummy = $(''); if (prefix == '#') { // hashtag - dummy.attr('href', $.MAL.hashtagUrl(partialName)); - dummy.text('#' + partialName); - openHashtagModal.call(dummy.get(0), item); + partialName = _extractHashtag(partialName); + if (partialName) { + dummy.attr('href', $.MAL.hashtagUrl(partialName)); + dummy.text('#' + partialName); + openHashtagModal.call(dummy.get(0), item); + } } else { // username - dummy.attr('href', $.MAL.userUrl(partialName)); - openProfileModal.call(dummy.get(0), item); + partialName = _extractUsername(partialName); + if (partialName) { + dummy.attr('href', $.MAL.userUrl(partialName)); + openProfileModal.call(dummy.get(0), item); + } } return false; }