Fix "Cannot read properties of null" in cli/telemetry (#8443)
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
This commit is contained in:
parent
8a08cb8d2a
commit
0fa483283e
2 changed files with 6 additions and 1 deletions
5
.changeset/strong-colts-hang.md
Normal file
5
.changeset/strong-colts-hang.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"astro": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix "Cannot read properties of null" error in CLI code
|
|
@ -9,7 +9,7 @@ interface TelemetryOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function notify() {
|
export async function notify() {
|
||||||
const packageManager = (await whichPm(process.cwd())).name ?? 'npm';
|
const packageManager = (await whichPm(process.cwd()))?.name ?? 'npm';
|
||||||
await telemetry.notify(() => {
|
await telemetry.notify(() => {
|
||||||
console.log(msg.telemetryNotice(packageManager) + '\n');
|
console.log(msg.telemetryNotice(packageManager) + '\n');
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue