diff --git a/package-lock.json b/package-lock.json index 08478c7a0..1d4e5120d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@microsoft/microsoft-graph-client", - "version": "2.1.0-Preview.1", + "version": "2.1.0-Preview.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 033467a57..752a6da6f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/microsoft-graph-client", - "version": "2.1.0-Preview.1", + "version": "2.1.0-Preview.2", "description": "Microsoft Graph Client Library", "license": "MIT", "main": "lib/src/index.js", diff --git a/src/GraphRequest.ts b/src/GraphRequest.ts index 237266359..2077e5652 100644 --- a/src/GraphRequest.ts +++ b/src/GraphRequest.ts @@ -651,7 +651,7 @@ export class GraphRequest { method: RequestMethod.POST, body: serializeContent(content), }; - const className: string = content === undefined || content === null ? undefined : content.constructor.name; + const className: string = content && content.constructor && content.constructor.name; if (className === "FormData") { // Content-Type headers should not be specified in case the of FormData type content options.headers = {}; diff --git a/src/GraphRequestUtil.ts b/src/GraphRequestUtil.ts index 3d645ce6d..a9ab02bb1 100644 --- a/src/GraphRequestUtil.ts +++ b/src/GraphRequestUtil.ts @@ -41,7 +41,7 @@ export const urlJoin = (urlSegments: string[]): string => { */ export const serializeContent = (content: any): any => { - const className: string = content === undefined || content === null ? undefined : content.constructor.name; + const className: string = content && content.constructor && content.constructor.name; if (className === "Buffer" || className === "Blob" || className === "File" || className === "FormData" || typeof content === "string") { return content; } diff --git a/src/Version.ts b/src/Version.ts index bb4ac523c..64101ee23 100644 --- a/src/Version.ts +++ b/src/Version.ts @@ -12,4 +12,4 @@ * @module Version */ -export const PACKAGE_VERSION = "2.1.0-Preview.1"; +export const PACKAGE_VERSION = "2.1.0-Preview.2";