Skip to content

Commit 0fa4832

Browse files
Fix "Cannot read properties of null" in cli/telemetry (#8443)
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
1 parent 8a08cb8 commit 0fa4832

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/strong-colts-hang.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"astro": patch
3+
---
4+
5+
Fix "Cannot read properties of null" error in CLI code

packages/astro/src/cli/telemetry/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface TelemetryOptions {
99
}
1010

1111
export async function notify() {
12-
const packageManager = (await whichPm(process.cwd())).name ?? 'npm';
12+
const packageManager = (await whichPm(process.cwd()))?.name ?? 'npm';
1313
await telemetry.notify(() => {
1414
console.log(msg.telemetryNotice(packageManager) + '\n');
1515
return true;

0 commit comments

Comments
 (0)