mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 03:01:08 +01:00
fix crash when you go to /topics/nonexistant
This commit is contained in:
@@ -40,6 +40,7 @@ var templates = {};
|
||||
for (var t in templatesToLoad) {
|
||||
(function(file) {
|
||||
$.get('/templates/' + file + '.tpl?v=' + timestamp, function(html) {
|
||||
|
||||
var template = function() {
|
||||
this.toString = function() {
|
||||
return this.html;
|
||||
@@ -168,6 +169,12 @@ function load_template(callback, url, template) {
|
||||
|
||||
jQuery.get(API_URL + url, function(data) {
|
||||
|
||||
console.log(data);
|
||||
if(!data) {
|
||||
window.location.href = '/403';
|
||||
return;
|
||||
}
|
||||
|
||||
var tpl = templates.get_custom_map(url);
|
||||
|
||||
if (tpl == false && !templates[url]) {
|
||||
|
||||
Reference in New Issue
Block a user