Skip to content

Commit

Permalink
fix: PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
dzehnder committed Aug 20, 2024
1 parent 411ca3e commit 9bc2596
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/url-inspect/url-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export async function processUrlInspect(baseURL, context, pages) {
log.info(`Successfully inspected URL: ${page}`);

const filteredIndexStatusResult = {
verdict: inspectionResult.indexStatusResult.verdict,
lastCrawlTime: inspectionResult.indexStatusResult.lastCrawlTime,
verdict: inspectionResult.indexStatusResult?.verdict,
lastCrawlTime: inspectionResult.indexStatusResult?.lastCrawlTime,
};

const filteredRichResults = inspectionResult.richResultsResult.detectedItems.map(
const filteredRichResults = inspectionResult.richResultsResult?.detectedItems?.map(
(item) => {
const filteredItems = item.items.filter(
(issueItem) => issueItem.issues.some(
Expand All @@ -61,7 +61,7 @@ export async function processUrlInspect(baseURL, context, pages) {
).filter((item) => item.items.length > 0);

if (filteredRichResults.length > 0) {
filteredRichResults.verdict = inspectionResult.richResultsResult.verdict;
filteredRichResults.verdict = inspectionResult.richResultsResult?.verdict;
log.info(`Found ${filteredRichResults.length} rich results issues for URL: ${page}`);
} else {
log.info(`No rich results issues found for URL: ${page}`);
Expand Down

0 comments on commit 9bc2596

Please sign in to comment.