Skip to content

Commit

Permalink
Don't throw on unknown channels
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitrySharabin committed May 20, 2024
1 parent 9506ca4 commit 180178b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/channel-slider/channel-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,15 @@ export default class ChannelSlider extends NudeElement {
defaultValue: {
type: Number,
default () {
return this.defaultColor.get(this.channel);
try {
return this.defaultColor.get(this.channel);
}
catch {
// When there is no channel in the defaultColor color space, don't throw,
// but return the value of the first one. Eventually, everything will settle down,
// and the default value will be correct.
return this.defaultColor.coords[0];
}
},
reflect: {
from: "value",
Expand Down

0 comments on commit 180178b

Please sign in to comment.