Commit be3d0b7a authored by Fred Chasen's avatar Fred Chasen

Check if title exists

parent 51ed53fc
......@@ -188,7 +188,9 @@ class Printer extends EventEmitter {
const meta = await page.evaluate(() => {
let meta = {};
let title = document.querySelector("title");
meta.title = title.textContent.trim();
if (title) {
meta.title = title.textContent.trim();
}
let metaTags = document.querySelectorAll("meta");
[...metaTags].forEach((tag) => {
if (tag.name) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment