From fb688aee59d16d79dcf0fe933ee15db4a3703f56 Mon Sep 17 00:00:00 2001 From: COBOL-Erik <32245335+COBOL-Erik@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:44:54 +0100 Subject: [PATCH] Update GetJobs.ts encoding.trim() only works if encoding is interpreted as a string, but it might just be a number. Signed-off-by: COBOL-Erik <32245335+COBOL-Erik@users.noreply.github.com> --- packages/zosjobs/src/GetJobs.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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]); }