From 41c7bc572225cf098e2294c222619ec98bebd4a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Puiggen=C3=A9?= Date: Fri, 27 Feb 2015 17:00:19 +0100 Subject: [PATCH] Uncaught exception in Chrome --- .../theme/resources/js/graphite.theme.main.js | 24 +++++++++++-------- setup.py | 2 +- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/graphite/theme/resources/js/graphite.theme.main.js b/graphite/theme/resources/js/graphite.theme.main.js index ed58290..760ea56 100644 --- a/graphite/theme/resources/js/graphite.theme.main.js +++ b/graphite/theme/resources/js/graphite.theme.main.js @@ -320,10 +320,12 @@ function GraphiteTheme() { var css = el.className; if (css !== undefined) { $.each(omitajaxrequests_css, function(i, item) { - if (css.match(item)) { - omit = true; - return; - } + try { + if (css.match(item)) { + omit = true; + return; + } + } catch (e) {} }); if (omit == true) { return; @@ -449,13 +451,15 @@ function GraphiteTheme() { activedetected = true; } var aclass = ''; - if (runitem[3] != '') { + if (runitem[3] !== undefined) { // We only need the contentype-xx class - var re = /contenttype-.+/g; - var matches = runitem[3].match(re); - if (matches && matches.length > 0) { - aclass = 'class="'+matches[0]+'"'; - } + try { + var re = /contenttype-.+/g; + var matches = runitem[3].match(re); + if (matches && matches.length > 0) { + aclass = 'class="'+matches[0]+'"'; + } + } catch (e) {} } cssclass += '"'; var itemli = ''; diff --git a/setup.py b/setup.py index 41279af..adedbca 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import os -version = '1.1' +version = '1.1.1' setup(name='graphite.theme', version=version,