diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/rhbzpage.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/data/rhbzpage.js b/data/rhbzpage.js index 061f9ed..b45d9e2 100644 --- a/data/rhbzpage.js +++ b/data/rhbzpage.js @@ -548,11 +548,20 @@ function fillInWhiteBoard(PCIidArr) { var outStr = ""; var cardIDStr = ""; var cardIDArr = []; - var PCIid = PCIidArr[0] + "," + PCIidArr[1]; - - var cardName = constantData.chipNames[PCIid][0].toUpperCase(); - var titleElem = document.getElementById('short_desc_nonedit_display'); - titleElem.textContent = '[' + cardName + ']\u00A0' + titleElem.textContent; + var cardName = ""; + var PCIid = (PCIidArr[0] + "," + PCIidArr[1]).toUpperCase(); + + try { + cardName = constantData.chipNames[PCIid][0]; + } catch (e if e instanceof TypeError) { + alert("PCI ID " + PCIid + " is not known!"); + return ; // early termination + } catch (e) { + throw e; + } + clickMouse("editme_action"); + var titleElem = document.getElementById('short_desc'); + titleElem.value = '[' + cardName + ']\u00A0' + titleElem.value; document.getElementById("fillin_btn").style.display = "none"; } |