registry-js icon indicating copy to clipboard operation
registry-js copied to clipboard

Undefined elements returned from enumerateValues

Open trew opened this issue 3 years ago • 0 comments

https://github.com/desktop/registry-js/blob/master/src/main.cc#L109 This line allocates an array of fixed size, which is then populated with values on these lines: https://github.com/desktop/registry-js/blob/master/src/main.cc#L133:L149

Only REG_SZ, REG_EXPAND_SZ and REG_DWORD is supported.

If an unsupported value is enumerated, this produces an array in typescript that could end up looking like this:

[{ ... REG_DWORD value }, undefined, { ...REG_SZ value }]

The typings does not reflect that undefined is a possibility. Either the typings should change, or the array returned from the EnumerateValues function should not return empty values.

trew avatar Feb 08 '21 13:02 trew