diff --git a/packages/salesforce/src/connection/salesforceConnection.ts b/packages/salesforce/src/connection/salesforceConnection.ts index 831fef45..fd123492 100644 --- a/packages/salesforce/src/connection/salesforceConnection.ts +++ b/packages/salesforce/src/connection/salesforceConnection.ts @@ -77,7 +77,9 @@ export class SalesforceConnection extends Connection { this.tooling['_logger'] = new JsForceLogAdapter(this.logger); // Overwrite refresh function on refresh delegate - this['_refreshDelegate']['_refreshFn'] = SalesforceConnection.refreshAccessToken; + if (this['_refreshDelegate']) { + this['_refreshDelegate']['_refreshFn'] = SalesforceConnection.refreshAccessToken; + } } private static refreshAccessToken(_this: SalesforceConnection, callback: (err: any, accessToken?: string, response?: any) => void) : Promise {