From 6d96b94f30031e67dcb8ea4464078336e521e5b8 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 5 Dec 2016 14:06:57 -0500 Subject: [PATCH] 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 --- Open-ILS/xul/staff_client/chrome/content/util/timestamp.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.11.0