Skip to content

Commit

Permalink
fix: default value if getBoundingClientRect undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
spnngl committed Nov 2, 2023
1 parent dcb2cb0 commit a8531e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion grafana_pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const auth_header = 'Basic ' + new Buffer.from(auth_string).toString('base64');

// Get the height of the main canvas, and add a margin
var height_px = await page.evaluate(() => {
return document.getElementsByClassName('react-grid-layout')[0].getBoundingClientRect().bottom;
return document.getElementsByClassName('react-grid-layout')[0].getBoundingClientRect?.().bottom || 540 ;
}) + 20;

//Francois: wait for page to be navigable (2min should be more than enough for longrange queries)
Expand Down

0 comments on commit a8531e0

Please sign in to comment.