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:
Mohammed Elhaouari 2023-09-07 09:39:42 +01:00 committed by GitHub
parent 8a08cb8d2a
commit 0fa483283e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"astro": patch
---
Fix "Cannot read properties of null" error in CLI code

View file

@ -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;