scttcper / ngx-color

🎨 Color Pickers from Sketch, Photoshop, Chrome, Github, Twitter & more
https://ngx-color.vercel.app
MIT License
436 stars 55 forks source link

fix(color-wrap): change member type changes to allow undefined #347

Closed mmuenker closed 3 years ago

mmuenker commented 3 years ago

In the edge case that a ColorWrapComponent is destroyed before initialized, the member changes is undefined. To prevent a TypeError exception is thrown, the unsubscribe method is only called if the member changes is defined.

codecov-commenter commented 3 years ago

Codecov Report

Merging #347 (09e18e6) into control (b591676) will increase coverage by 1.99%. The diff coverage is 0.00%.

:exclamation: Current head 09e18e6 differs from pull request most recent head 4e2f228. Consider uploading reports for the commit 4e2f228 to get more accurate results Impacted file tree graph

@@             Coverage Diff             @@
##           control     #347      +/-   ##
===========================================
+ Coverage    54.73%   56.73%   +1.99%     
===========================================
  Files           45       45              
  Lines          707      661      -46     
  Branches       154      153       -1     
===========================================
- Hits           387      375      -12     
+ Misses         295      260      -35     
- Partials        25       26       +1     
Impacted Files Coverage Δ
src/lib/common/color-wrap.component.ts 73.33% <0.00%> (+18.49%) :arrow_up:
src/lib/components/material/material.component.ts 57.14% <0.00%> (+2.59%) :arrow_up:
src/lib/components/sketch/sketch.component.ts 63.63% <0.00%> (+5.30%) :arrow_up:
src/lib/components/twitter/twitter.component.ts 76.92% <0.00%> (+5.49%) :arrow_up:
src/lib/components/hue/hue-picker.component.ts 75.00% <0.00%> (+5.76%) :arrow_up:
src/lib/components/circle/circle.component.ts 72.72% <0.00%> (+6.06%) :arrow_up:
src/lib/components/compact/compact.component.ts 72.72% <0.00%> (+6.06%) :arrow_up:
src/lib/components/block/block.component.ts 92.30% <0.00%> (+6.59%) :arrow_up:
src/lib/components/github/github.component.ts 66.66% <0.00%> (+6.66%) :arrow_up:
src/lib/components/alpha/alpha-picker.component.ts 90.90% <0.00%> (+7.57%) :arrow_up:
... and 6 more

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 b591676...4e2f228. Read the comment docs.

scttcper commented 3 years ago

:tada: This PR is included in version 7.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: