webpack / webpack-sources

Source code handling classes for webpack
MIT License
261 stars 71 forks source link

Use optional chaning in streamChunksOfCombinedSourceMap.js #133

Closed ferdinandhof closed 3 years ago

ferdinandhof commented 3 years ago

This fixed a "Cannot read property 'length' of null" for me when originalSourceLines is null for some reason (happened on require("xlsx") in an electron forge project under Windows).

alexander-akait commented 3 years ago

It is not fix, we should investigate why it is null, no need monkey patching to fix the problems

alexander-akait commented 3 years ago

Also we have originalSourceLines !== null check

ferdinandhof commented 3 years ago

I am really no expert but doesn't originalSourceLines.length ? ... : ... do a check against undefined or null? and since originalSourceLines.length can never produce undefined or null redundant in this case?

alexander-akait commented 3 years ago

Please provide steps how we can reproduce it

alexander-akait commented 3 years ago

Also fixes without tests is bad practice

ferdinandhof commented 3 years ago

Tests need to be approved by a maintainer. Can't run those workflows. I will try to figure out if I can get a bare project to produce this error.