fix(core): do not destructure potential null value in watch callback
This commit is contained in:
parent
b12586551b
commit
4398932d0e
@ -520,13 +520,13 @@ function debounce(fn: (...args) => void, time: number) {
|
|||||||
function createFileWatcher() {
|
function createFileWatcher() {
|
||||||
return daemonClient.registerFileWatcher(
|
return daemonClient.registerFileWatcher(
|
||||||
{ watchProjects: 'all', includeGlobalWorkspaceFiles: true },
|
{ watchProjects: 'all', includeGlobalWorkspaceFiles: true },
|
||||||
debounce(async (error, { changedFiles }) => {
|
debounce(async (error, changes) => {
|
||||||
if (error === 'closed') {
|
if (error === 'closed') {
|
||||||
output.error({ title: `Watch error: Daemon closed the connection` });
|
output.error({ title: `Watch error: Daemon closed the connection` });
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
} else if (error) {
|
} else if (error) {
|
||||||
output.error({ title: `Watch error: ${error?.message ?? 'Unknown'}` });
|
output.error({ title: `Watch error: ${error?.message ?? 'Unknown'}` });
|
||||||
} else if (changedFiles.length > 0) {
|
} else if (changes !== null && changes.changedFiles.length > 0) {
|
||||||
output.note({ title: 'Recalculating project graph...' });
|
output.note({ title: 'Recalculating project graph...' });
|
||||||
|
|
||||||
const newGraphClientResponse = await createDepGraphClientResponse();
|
const newGraphClientResponse = await createDepGraphClientResponse();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user