Skip to content

Commit

Permalink
Fix problem with iterating over undefined value
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszchudyk committed Nov 9, 2022
1 parent 78059d0 commit 7b7e02c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## [1.5.1] (2022-11-09)

### Fixed
- Problem with iterating over undefined

## [1.5.0] (2022-08-09)

### Changed
Expand Down Expand Up @@ -91,6 +96,7 @@ Display a hover with following conversions of the pointed hexadecimal value:



[1.5.1]: https://github.com/mateuszchudyk/vscode-hexinspector/compare/v1.5.0...v1.5.1
[1.5.0]: https://github.com/mateuszchudyk/vscode-hexinspector/compare/v1.4.0...v1.5.0
[1.4.0]: https://github.com/mateuszchudyk/vscode-hexinspector/compare/v1.3.0...v1.4.0
[1.3.0]: https://github.com/mateuszchudyk/vscode-hexinspector/compare/v1.2.0...v1.3.0
Expand Down
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": "hexinspector",
"displayName": "HexInspector",
"description": "Provides fast and easy way to peek other forms of a hexadecimal/decimal/binary value",
"version": "1.5.0",
"version": "1.5.1",
"publisher": "mateuszchudyk",
"license": "MIT",
"repository": {
Expand Down
14 changes: 7 additions & 7 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function activate(context: vscode.ExtensionContext) {
}

let bytes: Uint8Array;
let formsMap : input_handlers.MapFormToFunction;
let formsMap: input_handlers.MapFormToFunction;

for (let inputDataType of inputDataTypes) {
let inputHandler = input_handlers.createInputHandler(inputDataType);
Expand All @@ -34,13 +34,13 @@ export function activate(context: vscode.ExtensionContext) {
formsMap = inputHandler.getFormsMap();
}

let formMaxLength = 0;
for (let form of forms) {
if (form in formsMap)
formMaxLength = Math.max(formMaxLength, form.length);
}

if (bytes) {
let formMaxLength = 0;
for (let form of forms) {
if (form in formsMap)
formMaxLength = Math.max(formMaxLength, form.length);
}

let length = bytes.length;
let message = 'HexInspector: ' + word + ' (' + length + 'B)\n\n';
for (let form of forms) {
Expand Down

0 comments on commit 7b7e02c

Please sign in to comment.