From: Matt Tyson Date: Wed, 10 Sep 2014 15:05:52 +0000 (+0800) Subject: Bug 1036242: "TypeError: bug_status is undefined" when creating a bug X-Git-Tag: bugzilla-4.4.6~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7dd74777c86622a4290721c95510c5ad0762d72d;p=thirdparty%2Fbugzilla.git Bug 1036242: "TypeError: bug_status is undefined" when creating a bug r=glob,a=sgreen --- diff --git a/js/field.js b/js/field.js index c0d0aaa6ee..356c0cd5aa 100644 --- a/js/field.js +++ b/js/field.js @@ -46,10 +46,14 @@ function validateEnterBug(theform) { _errorFor(attach_desc, 'attach_desc'); focus_me = attach_desc; } - var check_description = status_comment_required[bug_status.value]; - if (check_description && YAHOO.lang.trim(description.value) == '') { - _errorFor(description, 'description'); - focus_me = description; + // bug_status can be undefined if the bug_status field is not editable by + // the currently logged in user. + if (bug_status) { + var check_description = status_comment_required[bug_status.value]; + if (check_description && YAHOO.lang.trim(description.value) == '') { + _errorFor(description, 'description'); + focus_me = description; + } } if (YAHOO.lang.trim(short_desc.value) == '') { _errorFor(short_desc);