Skip to content
Snippets Groups Projects
Commit be3d0b7a authored by Fred Chasen's avatar Fred Chasen
Browse files

Check if title exists

parent 51ed53fc
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
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