Skip to content

Commit 6f39a8c

Browse files
author
Johannes Gijsbers
committed
Fix JavaScript error when help was asked while no keyword was defined.
(patch by Kurt Steinkraus)
1 parent 39d737c commit 6f39a8c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

templates/classic/html/help_controls.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ function trim(value) {
5353

5454
function updateList() {
5555
// write back to opener window
56+
if (document.frm_help.check==undefined) { return; }
5657
var list = new Array();
5758
for (box=0; box < document.frm_help.check.length; box++) {
5859
if (document.frm_help.check[box].checked) {
@@ -64,6 +65,7 @@ function updateList() {
6465

6566
function updatePreview() {
6667
// add new checkbox selections to preview
68+
if (document.frm_help.check==undefined) { return; }
6769
var list = new Array();
6870
for (box=0; box < document.frm_help.check.length; box++) {
6971
if (document.frm_help.check[box].checked) {
@@ -76,13 +78,15 @@ function updatePreview() {
7678

7779
function clearList() {
7880
// uncheck all checkboxes
81+
if (document.frm_help.check==undefined) { return; }
7982
for (box=0; box < document.frm_help.check.length; box++) {
8083
document.frm_help.check[box].checked = false;
8184
}
8285
}
8386

8487
function reviseList(vals) {
8588
// update the checkboxes based on the preview field
89+
if (document.frm_help.check==undefined) { return; }
8690
var to_check;
8791
var list = vals.split(",");
8892
for (box=0; box < document.frm_help.check.length; box++) {
@@ -100,6 +104,7 @@ function reviseList(vals) {
100104

101105
function resetList() {
102106
// reset preview and check boxes to initial values
107+
if (document.frm_help.check==undefined) { return; }
103108
var to_check;
104109
var list = original_field.split(',');
105110
writePreview(list);

0 commit comments

Comments
 (0)