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:
Sam 2018-09-06 17:24:12 +10:00
parent 1f636c445b
commit 56b6a4779d

View File

@ -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;
}