webpack / webpack-sources

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

Don't call size() or source() functions on child if child is undefined #47

Closed MichaelCharles closed 5 years ago

MichaelCharles commented 5 years ago

When used in combination with webpack-dev-server, during a hot reload, I've encountered an error "Cannot read property size of undefined."

Doing a check to make sure that the child is defined in the size and source methods of ConcatSource solves this issue for me.

jsf-clabot commented 5 years ago

CLA assistant check
All committers have signed the CLA.

codecov[bot] commented 5 years ago

Codecov Report

Merging #47 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #47   +/-   ##
=======================================
  Coverage   78.25%   78.25%           
=======================================
  Files          11       11           
  Lines         492      492           
  Branches       76       76           
=======================================
  Hits          385      385           
  Misses        107      107
Impacted Files Coverage Δ
lib/ConcatSource.js 89.09% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7f952e3...bac6547. Read the comment docs.