check length of returned tr array to prevent errors in js log

pull/2926/head
Isaac Connor 2020-04-06 11:59:27 -04:00
parent 12252f1f37
commit 6a9a8f1d5f
1 changed files with 1 additions and 1 deletions

View File

@ -175,7 +175,7 @@ function clearLog() {
var clearReq = new Request.JSON({url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: clearResponse});
var tbody = $(logTable).getElement('tbody');
var rows = tbody.getElements('tr');
if ( rows ) {
if ( rows && rows.length ) {
var minTime = rows[0].getElement('td').get('text');
clearParms += "&minTime="+encodeURIComponent(minTime);
var maxTime = rows[rows.length-1].getElement('td').get('text');