fix crash when you go to /topics/nonexistant

This commit is contained in:
Baris Usakli
2013-05-16 12:13:39 -04:00
parent 9d5f6364ad
commit 34432773d6
4 changed files with 39 additions and 0 deletions

View File

@@ -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]) {