From: Bill Erickson Date: Mon, 5 Dec 2016 19:06:57 +0000 (-0500) Subject: CAT-72 Claims return dialog sanity checks X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6d96b94f30031e67dcb8ea4464078336e521e5b8;p=working%2FEvergreen.git CAT-72 Claims return dialog sanity checks Avoid the following error when editing hold shelf expire time: timestamp.js, handle_apply(): TypeError: document.getElementById("newRadio1") is null Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/xul/staff_client/chrome/content/util/timestamp.js b/Open-ILS/xul/staff_client/chrome/content/util/timestamp.js index 408f94bd21..4ae7232fc0 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/timestamp.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/timestamp.js @@ -135,7 +135,11 @@ function gen_handle_apply(params) { var dp = $('datepicker'); var tp = $('timepicker'); - var radio1On = document.getElementById("newRadio1").getAttribute("selected"); + + // newRadio1 is not always present in the DOM. + var radioDom = document.getElementById("newRadio1"); + var radio1On = + radioDom ? radioDom.getAttribute("selected") : false; var check = check_date( dp.value ); if ( ! check.allowed ) { alert( check.reason ); $('apply_btn').disabled = true; return; }