Skip to content

Commit 7b7e02c

Browse files
committed
Fix problem with iterating over undefined value
1 parent 78059d0 commit 7b7e02c

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## [1.5.1] (2022-11-09)
4+
5+
### Fixed
6+
- Problem with iterating over undefined
7+
38
## [1.5.0] (2022-08-09)
49

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

9297

9398

99+
[1.5.1]: https://github.com/mateuszchudyk/vscode-hexinspector/compare/v1.5.0...v1.5.1
94100
[1.5.0]: https://github.com/mateuszchudyk/vscode-hexinspector/compare/v1.4.0...v1.5.0
95101
[1.4.0]: https://github.com/mateuszchudyk/vscode-hexinspector/compare/v1.3.0...v1.4.0
96102
[1.3.0]: https://github.com/mateuszchudyk/vscode-hexinspector/compare/v1.2.0...v1.3.0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "hexinspector",
33
"displayName": "HexInspector",
44
"description": "Provides fast and easy way to peek other forms of a hexadecimal/decimal/binary value",
5-
"version": "1.5.0",
5+
"version": "1.5.1",
66
"publisher": "mateuszchudyk",
77
"license": "MIT",
88
"repository": {

src/extension.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function activate(context: vscode.ExtensionContext) {
1919
}
2020

2121
let bytes: Uint8Array;
22-
let formsMap : input_handlers.MapFormToFunction;
22+
let formsMap: input_handlers.MapFormToFunction;
2323

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

37-
let formMaxLength = 0;
38-
for (let form of forms) {
39-
if (form in formsMap)
40-
formMaxLength = Math.max(formMaxLength, form.length);
41-
}
42-
4337
if (bytes) {
38+
let formMaxLength = 0;
39+
for (let form of forms) {
40+
if (form in formsMap)
41+
formMaxLength = Math.max(formMaxLength, form.length);
42+
}
43+
4444
let length = bytes.length;
4545
let message = 'HexInspector: ' + word + ' (' + length + 'B)\n\n';
4646
for (let form of forms) {

0 commit comments

Comments
 (0)