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

This commit is contained in:
Isaac Connor 2020-04-06 11:59:27 -04:00
parent 191f05334b
commit ea8fe7b9a9
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');