From 19e360649dd1ec8566c7c119c88944b0dc89827c Mon Sep 17 00:00:00 2001 From: Spencer Murray Date: Thu, 5 Dec 2024 15:28:10 -0500 Subject: [PATCH 1/2] Couple bug fixes --- src/content/github/file/main.tsx | 2 +- src/content/github/pr/main.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/content/github/file/main.tsx b/src/content/github/file/main.tsx index 9d98fa1..e9643b5 100644 --- a/src/content/github/file/main.tsx +++ b/src/content/github/file/main.tsx @@ -67,7 +67,7 @@ async function main(): Promise { return; } globals.coverageButton = createCoverageButton(); - process(urlMetadata); + await process(urlMetadata); } catch (e) { Sentry.captureException(e); throw e; diff --git a/src/content/github/pr/main.tsx b/src/content/github/pr/main.tsx index af19419..2eaedb8 100644 --- a/src/content/github/pr/main.tsx +++ b/src/content/github/pr/main.tsx @@ -47,7 +47,12 @@ async function execute() { createContainer(); const coverageReport = await getPRReport(urlMetadata); - if (!coverageReport.files) { + if ( + !coverageReport.files || + !coverageReport.totals.base.coverage || + !coverageReport.totals.head.coverage || + !coverageReport.totals.patch.coverage + ) { showError(); return; } From d6342e5ec42251d3580f648b979bc50f7a594f10 Mon Sep 17 00:00:00 2001 From: Spencer Murray Date: Fri, 6 Dec 2024 09:49:46 -0500 Subject: [PATCH 2/2] Do proper null/undefined chaining --- src/content/github/pr/main.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/content/github/pr/main.tsx b/src/content/github/pr/main.tsx index 2eaedb8..1ab4c04 100644 --- a/src/content/github/pr/main.tsx +++ b/src/content/github/pr/main.tsx @@ -48,10 +48,10 @@ async function execute() { const coverageReport = await getPRReport(urlMetadata); if ( - !coverageReport.files || - !coverageReport.totals.base.coverage || - !coverageReport.totals.head.coverage || - !coverageReport.totals.patch.coverage + !coverageReport?.files || + !coverageReport?.totals?.base?.coverage || + !coverageReport?.totals?.head?.coverage || + !coverageReport?.totals?.patch?.coverage ) { showError(); return;