Skip to content

Commit

Permalink
handle nulls
Browse files Browse the repository at this point in the history
Took 16 minutes
  • Loading branch information
dport96 committed May 21, 2024
1 parent fea7f7b commit fb793d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nrts/activities.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function handleQueryResponse(response) {
var data = response.getDataTable();
var jsonData = JSON.parse(data.toJSON());

let tabledata = jsonData.rows.map(row => row.c.map(cell => cell.f))[0];
let tabledata = jsonData.rows.map(row => row.c.map(cell => cell ? cell.f : ''))[0];
let headers = jsonData.cols.map(col => col.label);
tableHtml = '<table class="table table-bordered"><tbody><thead><tr><th>Activity</th><th>Completed Date</th></tr></thead>';
for(let i = 3; i < headers.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion nrts/training.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function handleQueryResponse(response) {
var data = response.getDataTable();
var jsonData = JSON.parse(data.toJSON());

let tabledata = jsonData.rows.map(row => row.c.map(cell => cell.v))[0];
let tabledata = jsonData.rows.map(row => row.c.map(cell => cell ? cell.v : ''))[0];
let headers = jsonData.cols.map(col => col.label);
const primaryMentorIndex = headers.indexOf("Primary Mentor");
const secondaryMentorIndex = headers.indexOf("Secondary Mentor");
Expand Down

0 comments on commit fb793d7

Please sign in to comment.