diff --git a/packages/zosjobs/src/GetJobs.ts b/packages/zosjobs/src/GetJobs.ts index 4e7c510f1..438571b41 100644 --- a/packages/zosjobs/src/GetJobs.ts +++ b/packages/zosjobs/src/GetJobs.ts @@ -375,7 +375,10 @@ export class GetJobs { ImperativeExpect.toNotBeNullOrUndefined(spoolId, "Required parameter spoolId must be defined"); let parameters: string = "/" + encodeURIComponent(jobname) + "/" + encodeURIComponent(jobid) + JobsConstants.RESOURCE_SPOOL_FILES + "/" + encodeURIComponent(spoolId) + JobsConstants.RESOURCE_SPOOL_CONTENT; - if (encoding && encoding.trim() != "") {parameters += "?fileEncoding=" + encoding;} + if (encoding) { + encoding = String(encoding); + if(encoding.trim() != "") {parameters += "?fileEncoding=" + encoding;} + } Logger.getAppLogger().info("GetJobs.getSpoolContentById() parameters: " + parameters); return ZosmfRestClient.getExpectString(session, JobsConstants.RESOURCE + parameters, [Headers.TEXT_PLAIN_UTF8]); }