Skip to content

Commit

Permalink
Fix Bug in mtm.ts with Buffer and string
Browse files Browse the repository at this point in the history
Use the `toString()` method of the `Buffer` to convert a file that is
read to a `string`. Previous version was type casting, which worked
before. Now the read file method returns a `Buffer`.
  • Loading branch information
mischareitsma authored and c4xuxo committed Jan 19, 2023
1 parent ac60aa6 commit 9e90e01
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to the "vscode-psl" extension will be documented in this
file.

## v1.12.1

* Fix of bug where `Buffer` was not decoded to a `string`.

## v1.12.0

* Update dependencies.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Profile Scripting Language functionality for Visual Studio Code.

## Dependencies

* Visual Studio Code version 1.29 or higher.
* Visual Studio Code version 1.72.2 or higher.

## Environment Configuration

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-psl",
"displayName": "vscode-psl",
"description": "Profile Scripting Language support",
"version": "1.12.0",
"version": "1.12.1",
"preview": true,
"publisher": "ing-bank",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion src/mtm/mtm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export class MtmConnection {

private async _send(filename: string) {
let returnString: string;
let fileString: string = await readFileAsync(filename, {encoding: this.encoding}) as string;
let fileString: string = (await readFileAsync(filename, {encoding: this.encoding})).toString(this.encoding);
let fileContentLength: number = fileString.length;
let totalLoop: number = Math.ceil(fileContentLength / 1024);
let codeToken: string = '';
Expand Down

0 comments on commit 9e90e01

Please sign in to comment.