Skip to content

Commit

Permalink
fix(core): do not destructure potential null value in watch callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Cammisuli authored and vsavkin committed May 29, 2023
1 parent b125865 commit 4398932
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/nx/src/command-line/graph/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,13 +520,13 @@ function debounce(fn: (...args) => void, time: number) {
function createFileWatcher() {
return daemonClient.registerFileWatcher(
{ watchProjects: 'all', includeGlobalWorkspaceFiles: true },
debounce(async (error, { changedFiles }) => {
debounce(async (error, changes) => {
if (error === 'closed') {
output.error({ title: `Watch error: Daemon closed the connection` });
process.exit(1);
} else if (error) {
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...' });

const newGraphClientResponse = await createDepGraphClientResponse();
Expand Down

1 comment on commit 4398932

@vercel
Copy link

@vercel vercel bot commented on 4398932 May 29, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev

Please sign in to comment.