diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-05-05 12:02:51 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-06-05 14:51:41 +0200 |
commit | c603f0a1a2985bf225786122beeaf248ca87cd99 (patch) | |
tree | 4c2523d9d06abef983c9feb3cd93ccc6a3ad6d82 | |
parent | 45213cd6b0810fd74eede4c06fae768350f10e9f (diff) | |
download | bugzilla-triage-c603f0a1a2985bf225786122beeaf248ca87cd99.tar.gz |
Make the script more reliable against JSON-hosting sites being down.
Fixes #92
-rw-r--r-- | data/lib/otherButtons.js | 8 | ||||
-rw-r--r-- | lib/libbugzilla.js | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/data/lib/otherButtons.js b/data/lib/otherButtons.js index a766668..6bcc043 100644 --- a/data/lib/otherButtons.js +++ b/data/lib/otherButtons.js @@ -113,9 +113,9 @@ function addingEmbelishments(list) { } // TODO Get compiz bugs as well - if ((constantData.chipNames) && (list[0]) + if ((new Boolean(constantData.chipNames)) && (list[0].length > 0) && (!FillMagicDoneRE.test(getSummary())) - && (maintCCAddr === "xgl-maint@redhat.com")) { + && (maintCCAddr == "xgl-maint@redhat.com")) { // Add find chip magic button var whiteboard_string = document .getElementById("status_whiteboard").value; @@ -197,8 +197,8 @@ function setBranding(xLogAtts) { var compElems; if (config.suspiciousComponents && isInList(getComponent(), config.suspiciousComponents) - && (compElems = document - .getElementById("bz_component_edit_container"))) { + && ((compElems = document + .getElementById("bz_component_edit_container")))) { compElems.style.background = "red none"; } diff --git a/lib/libbugzilla.js b/lib/libbugzilla.js index a1792ea..3763eff 100644 --- a/lib/libbugzilla.js +++ b/lib/libbugzilla.js @@ -379,6 +379,8 @@ exports.initialize = function initialize(config, callback) { onComplete: function(response) { if (response.status == 200) { config.constantData[title] = response.json; + } else { + console.error("Cannot download " + title + " from URL " + url); } } }).get(); |