Fix js error when custom sql query returns no results

This commit is contained in:
Dan Sosedoff 2016-01-20 09:21:31 -06:00
parent d3f12802a3
commit bd207a3551
3 changed files with 8 additions and 3 deletions

View File

@ -239,6 +239,11 @@ func (client *Client) query(query string, args ...interface{}) (*Result, error)
return nil, err
}
// Make sure to never return null colums
if cols == nil {
cols = []string{}
}
result := Result{
Columns: cols,
Rows: []Row{},

File diff suppressed because one or more lines are too long

View File

@ -230,7 +230,7 @@ function buildTable(results, sortColumn, sortOrder) {
return;
}
if (!results.rows) {
if (results.rows.length == 0) {
$("<tr><td>No records found</tr></tr>").appendTo("#results");
$("#results").addClass("empty");
return;