python-wled icon indicating copy to clipboard operation
python-wled copied to clipboard

possible key error exception

Open smirgol opened this issue 1 year ago • 0 comments

While troubleshooting an issue, I've stumbled upon this erroneous check:

https://github.com/frenck/python-wled/blob/e427bd63eb960ab66d379fd070780ed476215d16/src/wled/models.py#L713C13-L713C50

If the key is not in the dict (k not in data), accessing that non-existent key (and data[k]) will throw an KeyError exception. I assume it should be like

if any(
    k not in data or data[k] is None
    for k in ("effects", "palettes", "info", "state")
):

cheers!

smirgol avatar Mar 21 '24 13:03 smirgol