This PR adds a check to avoid dereferencing NULL inside simpleElement.
If the given mixer's element list is empty, both snd_mixer_first_elem and snd_mixer_last_elem will return NULL, which means elements' will return nullPtr : [] == [nullPtr].
This is triggered e.g. here, when xmobar will crash immediately after system start or resume from suspend, when mixer elements are not available yet for a short time.
This PR adds a check to avoid dereferencing NULL inside
simpleElement
.If the given mixer's element list is empty, both snd_mixer_first_elem and snd_mixer_last_elem will return
NULL
, which meanselements'
will returnnullPtr : [] == [nullPtr]
.This is triggered e.g. here, when xmobar will crash immediately after system start or resume from suspend, when mixer elements are not available yet for a short time.