mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 03:08:35 +08:00
FIX: make route to tag more robust
There are some edge cases where code would fail here, so adding protection
This commit is contained in:
parent
1f636c445b
commit
56b6a4779d
|
@ -153,7 +153,12 @@ const DiscourseURL = Ember.Object.extend({
|
|||
},
|
||||
|
||||
routeToTag(a) {
|
||||
if (a && a.host !== document.location.host) {
|
||||
// skip when we are provided nowhere to route to
|
||||
if (!a || !a.href) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a.host !== document.location.host) {
|
||||
document.location = a.href;
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user