Skip to content

Commit

Permalink
Fix "Cannot read properties of null" in cli/telemetry (#8443)
Browse files Browse the repository at this point in the history
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
  • Loading branch information
the-dijkstra and Princesseuh committed Sep 7, 2023
1 parent 8a08cb8 commit 0fa4832
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/strong-colts-hang.md
@@ -0,0 +1,5 @@
---
"astro": patch
---

Fix "Cannot read properties of null" error in CLI code
2 changes: 1 addition & 1 deletion packages/astro/src/cli/telemetry/index.ts
Expand Up @@ -9,7 +9,7 @@ interface TelemetryOptions {
}

export async function notify() {
const packageManager = (await whichPm(process.cwd())).name ?? 'npm';
const packageManager = (await whichPm(process.cwd()))?.name ?? 'npm';
await telemetry.notify(() => {
console.log(msg.telemetryNotice(packageManager) + '\n');
return true;
Expand Down

1 comment on commit 0fa4832

@liltechnomancer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Please sign in to comment.