diff --git a/src/deviceOauthService.ts b/src/deviceOauthService.ts index 6f18cf2d3..6683ff6e3 100644 --- a/src/deviceOauthService.ts +++ b/src/deviceOauthService.ts @@ -48,7 +48,7 @@ interface DeviceCodeAuthError extends SfError { async function makeRequest(options: HttpRequest): Promise { const rawResponse = await new Transport().httpRequest(options); - if (rawResponse?.headers && rawResponse.headers['content-type'] === 'text/html') { + if (rawResponse?.headers?.['content-type'] === 'text/html') { const htmlResponseError = messages.createError('error.HttpApi'); htmlResponseError.setData(rawResponse.body); throw htmlResponseError;