diff --git a/src/utils/conflicts.ts b/src/utils/conflicts.ts index 65516529..f85a419c 100644 --- a/src/utils/conflicts.ts +++ b/src/utils/conflicts.ts @@ -8,9 +8,12 @@ import { ux } from '@oclif/core'; import { ConflictResponse } from '@salesforce/source-tracking'; -export const writeConflictTable = (conflicts: ConflictResponse[]): void => { +export const writeConflictTable = (conflicts?: ConflictResponse[]): void => { // Interfaces cannot be casted to Record so we have to cast to unknown first // See https://github.com/microsoft/TypeScript/issues/15300 + if (!conflicts || conflicts.length === 0) { + return; + } ux.table( conflicts.map((c) => ({ state: c.state, fullName: c.fullName, type: c.type, filePath: c.filePath })), {