beyondscreen / node-rpi-ws281x-native

native bindings to drive WS2811 (or WS2812) LED-Controllers on a Raspberry Pi
MIT License
224 stars 101 forks source link

Don't attempt to reset empty channels #71

Closed drewcovi closed 6 years ago

drewcovi commented 6 years ago

hit an error with this method when im only using one channel. quick check before diving in (because otherwise array is null).

usefulthink commented 6 years ago

Good catch, thanks! I decided to move the check into the _reset-function, which is how I already did it for _update, but that should be pretty much the same.